Skip to content

Commit 343e9e5

Browse files
committed
Convert env.openExternal to a noop for testing
We should not be opening any external links during tests. This is causing some builds to hang when running on CI. See #750 for an example.
1 parent f2620c6 commit 343e9e5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

extensions/ql-vscode/src/vscode-tests/index-template.ts

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as path from 'path';
22
import * as Mocha from 'mocha';
33
import * as glob from 'glob';
44
import { ensureCli } from './ensureCli';
5+
import { env } from 'vscode';
56

67

78
// Use this handler to avoid swallowing unhandled rejections.
@@ -45,6 +46,15 @@ export async function runTestsInDirectory(testsRoot: string, useCli = false): Pr
4546
color: true
4647
});
4748

49+
// See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49860
50+
// Need to update to 8.2.0 of the typings.
51+
(mocha as any).globalSetup(() => {
52+
// convert this function into an noop since it should not run during tests.
53+
// If it does run during tests, then it can cause some testing environments
54+
// to hang.
55+
(env as any).openExternal = () => { /**/ };
56+
});
57+
4858
await ensureCli(useCli);
4959

5060
return new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)