From 5940f0e128d9c6063dd1d8e1fe014a87f628c968 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder <231804+danez@users.noreply.github.com> Date: Wed, 12 Apr 2023 16:54:05 +0200 Subject: [PATCH] chore: test --- tests/integration/100.command.dev.test.cjs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/integration/100.command.dev.test.cjs b/tests/integration/100.command.dev.test.cjs index 0e4c8af9bf8..d36ffb44f2a 100644 --- a/tests/integration/100.command.dev.test.cjs +++ b/tests/integration/100.command.dev.test.cjs @@ -1,4 +1,3 @@ -// Handlers are meant to be async outside tests const path = require('path') // eslint-disable-next-line ava/use-test @@ -1020,6 +1019,10 @@ test('should have only allowed environment variables set', async (t) => { handler: () => new Response(`${JSON.stringify(Deno.env.toObject())}`), name: 'env', }) + .withContentFile({ + content: 'FROM_ENV="YAS"', + path: '.env', + }) await builder.buildAsync() @@ -1040,16 +1043,21 @@ test('should have only allowed environment variables set', async (t) => { ) const envKeys = Object.keys(response) - t.false(envKeys.includes('DENO_DEPLOYMENT_ID')) - // t.true(envKeys.includes('DENO_DEPLOYMENT_ID')) - // t.is(response.DENO_DEPLOYMENT_ID, 'xxx=') + t.true(envKeys.includes('PATH')) + t.true(envKeys.includes('DENO_REGION')) t.is(response.DENO_REGION, 'local') + t.true(envKeys.includes('NETLIFY_DEV')) t.is(response.NETLIFY_DEV, 'true') + t.true(envKeys.includes('SECRET_ENV')) t.is(response.SECRET_ENV, 'true') + t.true(envKeys.includes('FROM_ENV')) + t.is(response.FROM_ENV, 'YAS') + + t.false(envKeys.includes('DENO_DEPLOYMENT_ID')) t.false(envKeys.includes('NODE_ENV')) t.false(envKeys.includes('DEPLOY_URL')) t.false(envKeys.includes('URL'))