Skip to content

Commit

Permalink
test: Correcting bad .env watch test
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Apr 2, 2022
1 parent e07aef5 commit 4fe11a8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/cli/tests/watch.test.js
Expand Up @@ -37,9 +37,6 @@ describe('preact', () => {

it('should use a custom `.env` with prefixed environment variables', async () => {
let app = await create('default');
server = await watch(app, 8085);

let page = await loadPage(chrome, 'http://127.0.0.1:8085/');

let header = resolve(app, './src/components/header/index.js');
let original = await readFile(header, 'utf8');
Expand All @@ -48,6 +45,14 @@ describe('preact', () => {
'<h1>{process.env.PREACT_APP_MY_VARIABLE}</h1>'
);
await writeFile(header, update);
await writeFile(
resolve(app, '.env'),
'PREACT_APP_MY_VARIABLE="Hello World!"'
);

server = await watch(app, 8085);

let page = await loadPage(chrome, 'http://127.0.0.1:8085/');

// "Hello World!" should replace 'process.env.PREACT_APP_MY_VARIABLE'
await waitUntilExpression(
Expand Down

0 comments on commit 4fe11a8

Please sign in to comment.