@@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
33const ALL_ENV_VARS = [
44 'CONTEXT' ,
55 'VERCEL_ENV' ,
6- 'NUXT_ENV_URL ' ,
6+ 'URL ' ,
77 'NUXT_ENV_VERCEL_URL' ,
88 'NUXT_ENV_VERCEL_PROJECT_PRODUCTION_URL' ,
99]
@@ -31,7 +31,7 @@ describe('getPreviewUrl', () => {
3131 } )
3232
3333 it . each ( [
34- [ 'Netlify production' , { CONTEXT : 'production' , NUXT_ENV_URL : 'https://prod.example.com' } ] ,
34+ [ 'Netlify production' , { CONTEXT : 'production' , URL : 'https://prod.example.com' } ] ,
3535 [ 'Vercel production' , { VERCEL_ENV : 'production' , NUXT_ENV_VERCEL_URL : 'prod.example.com' } ] ,
3636 ] ) ( '%s environment returns `undefined`' , async ( _name , envVars ) => {
3737 for ( const [ key , value ] of Object . entries ( envVars ) ) {
@@ -43,29 +43,25 @@ describe('getPreviewUrl', () => {
4343 } )
4444
4545 it . each ( [
46- [
47- 'Netlify dev' ,
48- { CONTEXT : 'dev' , NUXT_ENV_URL : 'https://dev.example.com' } ,
49- 'https://dev.example.com' ,
50- ] ,
46+ [ 'Netlify dev' , { CONTEXT : 'dev' , URL : 'https://dev.example.com' } , 'https://dev.example.com' ] ,
5147 [
5248 'Netlify deploy-preview' ,
5349 {
5450 CONTEXT : 'deploy-preview' ,
55- NUXT_ENV_URL : 'https://preview.example.com' ,
51+ URL : 'https://preview.example.com' ,
5652 } ,
5753 'https://preview.example.com' ,
5854 ] ,
5955 [
6056 'Netlify branch-deploy' ,
61- { CONTEXT : 'branch-deploy' , NUXT_ENV_URL : 'https://beta.example.com' } ,
57+ { CONTEXT : 'branch-deploy' , URL : 'https://beta.example.com' } ,
6258 'https://beta.example.com' ,
6359 ] ,
6460 [
6561 'Netlify preview-server' ,
6662 {
6763 CONTEXT : 'branch-deploy' ,
68- NUXT_ENV_URL : 'https://my-feat--preview.example.com' ,
64+ URL : 'https://my-feat--preview.example.com' ,
6965 } ,
7066 'https://my-feat--preview.example.com' ,
7167 ] ,
@@ -113,23 +109,20 @@ describe('getProductionUrl', () => {
113109 } )
114110
115111 it . each ( [
116- [ 'Netlify dev' , { CONTEXT : 'dev' , NUXT_ENV_URL : 'https://dev.example.com' } ] ,
112+ [ 'Netlify dev' , { CONTEXT : 'dev' , URL : 'https://dev.example.com' } ] ,
117113 [
118114 'Netlify deploy-preview' ,
119115 {
120116 CONTEXT : 'deploy-preview' ,
121- NUXT_ENV_URL : 'https://preview.example.com' ,
117+ URL : 'https://preview.example.com' ,
122118 } ,
123119 ] ,
124- [
125- 'Netlify branch-deploy' ,
126- { CONTEXT : 'branch-deploy' , NUXT_ENV_URL : 'https://beta.example.com' } ,
127- ] ,
120+ [ 'Netlify branch-deploy' , { CONTEXT : 'branch-deploy' , URL : 'https://beta.example.com' } ] ,
128121 [
129122 'Netlify preview-server' ,
130123 {
131124 CONTEXT : 'preview-server' ,
132- NUXT_ENV_URL : 'https://my-feat--preview.example.com' ,
125+ URL : 'https://my-feat--preview.example.com' ,
133126 } ,
134127 ] ,
135128 [
@@ -158,7 +151,7 @@ describe('getProductionUrl', () => {
158151 it . each ( [
159152 [
160153 'Netlify production' ,
161- { CONTEXT : 'production' , NUXT_ENV_URL : 'https://prod.example.com' } ,
154+ { CONTEXT : 'production' , URL : 'https://prod.example.com' } ,
162155 'https://prod.example.com' ,
163156 ] ,
164157 [
0 commit comments