Skip to content

Commit 17cc1f3

Browse files
committed
test: Correcting bad .env watch test
1 parent 6ad9a23 commit 17cc1f3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/cli/tests/watch.test.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ describe('preact', () => {
3737

3838
it('should use a custom `.env` with prefixed environment variables', async () => {
3939
let app = await create('default');
40-
server = await watch(app, 8085);
41-
42-
let page = await loadPage(chrome, 'http://127.0.0.1:8085/');
4340

4441
let header = resolve(app, './src/components/header/index.js');
4542
let original = await readFile(header, 'utf8');
@@ -48,6 +45,14 @@ describe('preact', () => {
4845
'<h1>{process.env.PREACT_APP_MY_VARIABLE}</h1>'
4946
);
5047
await writeFile(header, update);
48+
await writeFile(
49+
resolve(app, '.env'),
50+
'PREACT_APP_MY_VARIABLE="Hello World!"'
51+
);
52+
53+
server = await watch(app, 8085);
54+
55+
let page = await loadPage(chrome, 'http://127.0.0.1:8085/');
5156

5257
// "Hello World!" should replace 'process.env.PREACT_APP_MY_VARIABLE'
5358
await waitUntilExpression(

0 commit comments

Comments
 (0)