Skip to content

Commit 337baf9

Browse files
committed
chore: test
1 parent 3b01f65 commit 337baf9

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

tests/integration/100.command.dev.test.cjs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Handlers are meant to be async outside tests
1+
const { platform } = require('os')
22
const path = require('path')
33

44
// eslint-disable-next-line ava/use-test
@@ -1020,6 +1020,10 @@ test('should have only allowed environment variables set', async (t) => {
10201020
handler: () => new Response(`${JSON.stringify(Deno.env.toObject())}`),
10211021
name: 'env',
10221022
})
1023+
.withContentFile({
1024+
content: 'FROM_ENV="YAS"',
1025+
path: '.env',
1026+
})
10231027

10241028
await builder.buildAsync()
10251029

@@ -1040,16 +1044,26 @@ test('should have only allowed environment variables set', async (t) => {
10401044
)
10411045
const envKeys = Object.keys(response)
10421046

1043-
t.false(envKeys.includes('DENO_DEPLOYMENT_ID'))
1044-
// t.true(envKeys.includes('DENO_DEPLOYMENT_ID'))
1045-
// t.is(response.DENO_DEPLOYMENT_ID, 'xxx=')
1047+
// On macOS there is always `__CF_USER_TEXT_ENCODING`
1048+
t.is(envKeys.length, platform() === 'darwin' ? 6 : 5)
1049+
1050+
console.log(envKeys)
1051+
1052+
t.true(envKeys.includes('PATH'))
1053+
10461054
t.true(envKeys.includes('DENO_REGION'))
10471055
t.is(response.DENO_REGION, 'local')
1056+
10481057
t.true(envKeys.includes('NETLIFY_DEV'))
10491058
t.is(response.NETLIFY_DEV, 'true')
1059+
10501060
t.true(envKeys.includes('SECRET_ENV'))
10511061
t.is(response.SECRET_ENV, 'true')
10521062

1063+
t.true(envKeys.includes('FROM_ENV'))
1064+
t.is(response.FROM_ENV, 'YAS')
1065+
1066+
t.false(envKeys.includes('DENO_DEPLOYMENT_ID'))
10531067
t.false(envKeys.includes('NODE_ENV'))
10541068
t.false(envKeys.includes('DEPLOY_URL'))
10551069
t.false(envKeys.includes('URL'))

0 commit comments

Comments
 (0)