Skip to content

Commit

Permalink
test: the environment variables should be set correctly on the windows (
Browse files Browse the repository at this point in the history
  • Loading branch information
yimingjfe committed May 27, 2024
1 parent 4079881 commit 251eca7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
18 changes: 15 additions & 3 deletions tests/integration/deploy-csr/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ describe('deploy', () => {
});

test('support csr when deploy target is node', async () => {
await execa('MODERNJS_DEPLOY=node npx modern deploy -s', {
await execa('npx modern deploy -s', {
shell: true,
cwd: appDir,
stdio: 'inherit',
env: {
...process.env,
MODERNJS_DEPLOY: 'node',
},
});
const outputDirectory = path.join(appDir, '.output');
const bootstrapJs = path.join(outputDirectory, 'index.js');
Expand All @@ -26,10 +30,14 @@ describe('deploy', () => {
});

test('support csr when deploy target is vercel', async () => {
await execa('MODERNJS_DEPLOY=vercel npx modern deploy -s', {
await execa('npx modern deploy -s', {
shell: true,
cwd: appDir,
stdio: 'inherit',
env: {
...process.env,
MODERNJS_DEPLOY: 'vercel',
},
});

const outputDirectory = path.join(appDir, '.vercel/output');
Expand All @@ -47,10 +55,14 @@ describe('deploy', () => {
});

test('support csr when deploy target is netlify', async () => {
await execa('MODERNJS_DEPLOY=netlify npx modern deploy -s', {
await execa('npx modern deploy -s', {
shell: true,
cwd: appDir,
stdio: 'inherit',
env: {
...process.env,
MODERNJS_DEPLOY: 'netlify',
},
});

const outputDirectory = path.join(appDir, 'dist');
Expand Down
18 changes: 15 additions & 3 deletions tests/integration/deploy-server/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ describe('deploy', () => {
});

test('support server when deploy target is node', async () => {
await execa('MODERNJS_DEPLOY=node npx modern deploy --skip-build', {
await execa('npx modern deploy --skip-build', {
shell: true,
cwd: appDir,
stdio: 'inherit',
env: {
...process.env,
MODERNJS_DEPLOY: 'node',
},
});
const outputDirectory = path.join(appDir, '.output');
const staticDirectory = path.join(outputDirectory, 'static');
Expand All @@ -29,10 +33,14 @@ describe('deploy', () => {
});

test('support server when deploy target is vercel', async () => {
await execa('MODERNJS_DEPLOY=vercel npx modern deploy --skip-build', {
await execa('npx modern deploy --skip-build', {
shell: true,
cwd: appDir,
stdio: 'inherit',
env: {
...process.env,
MODERNJS_DEPLOY: 'vercel',
},
});

const outputDirectory = path.join(appDir, '.vercel/output');
Expand All @@ -59,10 +67,14 @@ describe('deploy', () => {
});

test('support server when deploy target is netlify', async () => {
await execa('MODERNJS_DEPLOY=netlify npx modern deploy --skip-build', {
await execa('npx modern deploy --skip-build', {
shell: true,
cwd: appDir,
stdio: 'inherit',
env: {
...process.env,
MODERNJS_DEPLOY: 'netlify',
},
});

const publishDir = path.join(appDir, 'dist');
Expand Down

0 comments on commit 251eca7

Please sign in to comment.