MCPcopy
hub / github.com/VSCodeVim/Vim / run

Function run

test/index.ts:22–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20Globals.mockConfiguration = new Configuration();
21
22export function run(): Promise<void> {
23 const mochaGrep = new RegExp(process.env.MOCHA_GREP || '');
24
25 // Create the mocha test
26 const mocha = new Mocha({
27 ui: 'tdd',
28 color: true,
29 timeout: 5000,
30 grep: mochaGrep,
31 });
32
33 const testsRoot = path.resolve(__dirname, '.');
34
35 return new Promise((c, e) => {
36 glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
37 if (err) {
38 return e(err);
39 }
40
41 // Add files to the test suite
42 files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));
43
44 try {
45 // Run the mocha test
46 mocha.run((failures) => {
47 if (failures > 0) {
48 e(new Error(`${failures} tests failed.`));
49 } else {
50 c();
51 }
52 });
53 } catch (error) {
54 console.error(error);
55 e(error as Error);
56 }
57 });
58 });
59}

Callers

nothing calls this directly

Calls 3

errorMethod · 0.80
resolveMethod · 0.65
runMethod · 0.65

Tested by

no test coverage detected