diff options
author | vsrs <[email protected]> | 2020-05-21 09:34:34 +0100 |
---|---|---|
committer | vsrs <[email protected]> | 2020-05-21 09:34:34 +0100 |
commit | c41a10c29331127ee830badddae55f3e27c9a6ea (patch) | |
tree | b30bbcb65ff0717ea5a8b5060b288e03f157d1f5 /editors/code/tests/unit | |
parent | 8ee40ccbe963a0a5e3e998c1652378e1035dc40d (diff) |
Apply suggestions from @Veetaha code review
Diffstat (limited to 'editors/code/tests/unit')
-rw-r--r-- | editors/code/tests/unit/index.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/editors/code/tests/unit/index.ts b/editors/code/tests/unit/index.ts index 1deb1c403..5165720b4 100644 --- a/editors/code/tests/unit/index.ts +++ b/editors/code/tests/unit/index.ts | |||
@@ -11,10 +11,10 @@ export function run(): Promise<void> { | |||
11 | 11 | ||
12 | const testsRoot = __dirname; | 12 | const testsRoot = __dirname; |
13 | 13 | ||
14 | return new Promise((c, e) => { | 14 | return new Promise((resolve, reject) => { |
15 | glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { | 15 | glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { |
16 | if (err) { | 16 | if (err) { |
17 | return e(err); | 17 | return reject(err); |
18 | } | 18 | } |
19 | 19 | ||
20 | // Add files to the test suite | 20 | // Add files to the test suite |
@@ -25,13 +25,13 @@ export function run(): Promise<void> { | |||
25 | mocha.timeout(100000); | 25 | mocha.timeout(100000); |
26 | mocha.run(failures => { | 26 | mocha.run(failures => { |
27 | if (failures > 0) { | 27 | if (failures > 0) { |
28 | e(new Error(`${failures} tests failed.`)); | 28 | reject(new Error(`${failures} tests failed.`)); |
29 | } else { | 29 | } else { |
30 | c(); | 30 | resolve(); |
31 | } | 31 | } |
32 | }); | 32 | }); |
33 | } catch (err) { | 33 | } catch (err) { |
34 | e(err); | 34 | reject(err); |
35 | } | 35 | } |
36 | }); | 36 | }); |
37 | }); | 37 | }); |