Skip to content
This repository was archived by the owner on Jun 2, 2022. It is now read-only.

Commit 3d90fb9

Browse files
committed
test: try and close the demo server cleanly
1 parent 4b9407e commit 3d90fb9

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

test/disable.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ test('agent can be disabled', async (t) => {
3434
delete process.env.SNYK_BEACON_INTERVAL_MS;
3535
delete process.env.SNYK_RUNTIME_AGENT_DISABLE;
3636

37-
demoApp.close();
37+
await new Promise((resolve) => demoApp.close(resolve));
3838
});

test/e2e.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,5 +183,5 @@ test('demo app reports a vuln method when called', async (t) => {
183183
delete process.env.SNYK_SNAPSHOT_INTERVAL_MS;
184184
delete process.env.SNYK_TRIGGER_EXTRA_VULN;
185185

186-
demoApp.close();
186+
await new Promise((resolve) => demoApp.close(resolve));
187187
});

test/failures.test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ test('node agent does not crash the demo app', async (t) => {
2525
delete process.env.SNYK_HOMEBASE_URL;
2626
delete process.env.SNYK_BEACON_INTERVAL_MS;
2727

28-
demoApp.close();
29-
28+
await new Promise((resolve) => demoApp.close(resolve));
3029
});
3130

3231
test('node agent does not crash the demo app', async (t) => {
@@ -45,5 +44,5 @@ test('node agent does not crash the demo app', async (t) => {
4544
delete process.env.SNYK_SNAPSHOT_INTERVAL_MS;
4645
delete process.env.SNYK_BEACON_INTERVAL_MS;
4746

48-
demoApp.close();
47+
await new Promise((resolve) => demoApp.close(resolve));
4948
});

0 commit comments

Comments
 (0)