Skip to content

Commit 059405c

Browse files
author
Danny McCormick
authored
Clean environment after running mocks
1 parent 3fb9071 commit 059405c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

node/mock-test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ export class MockTestRunner {
6666
nodePath = this.getNodePath(nodeVersion);
6767
}
6868
let spawn = cp.spawnSync(nodePath, [this._testPath]);
69+
// Clean environment
70+
Object.keys(process.env)
71+
.filter(key => (key.substr(0, 'INPUT_'.length) === 'INPUT_' ||
72+
key.substr(0, 'SECRET_'.length) === 'SECRET_' ||
73+
key.substr(0, 'VSTS_TASKVARIABLE_'.length) === 'VSTS_TASKVARIABLE_'))
74+
.forEach(key => delete process.env[key]);
6975
if (spawn.error) {
7076
console.error('Running test failed');
7177
console.error(spawn.error.message);

0 commit comments

Comments
 (0)