Skip to content

Commit e9d4143

Browse files
committed
test: perform teardown in the beginning of tests to ensure clean env
1 parent e69c9bf commit e9d4143

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/integration/kubernetes.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,21 @@ import * as kubectl from '../helpers/kubectl';
2020
let integrationId: string;
2121
let namespace: string;
2222

23-
tap.tearDown(async() => {
23+
async function teardown(): Promise<void> {
2424
console.log('Begin removing the snyk-monitor...');
2525
await setup.removeMonitor();
2626
console.log('Removed the snyk-monitor!');
2727

2828
console.log('Begin removing "kind" network...');
2929
await setup.removeUnusedKindNetwork();
3030
console.log('Removed "kind" network');
31+
}
32+
33+
tap.tearDown(teardown);
34+
35+
tap.test('teardown any existing environment', async (t) => {
36+
await teardown();
37+
t.pass('starting from a clean environment');
3138
});
3239

3340
// Make sure this runs first -- deploying the monitor for the next tests

0 commit comments

Comments
 (0)