Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit beec29a

Browse files
committed
test: use async/await in test-debugger-profile
1 parent 95b0014 commit beec29a

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

test/sequential/test-debugger-profile.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,33 @@ const startCLI = require('../common/debugger');
99
const assert = require('assert');
1010

1111
function delay(ms) {
12-
return new Promise((resolve) => setTimeout(resolve, ms));
12+
return new Promise((resolve) => setTimeout(resolve, ms));
1313
}
1414

1515
// Profiles.
1616
{
17-
const cli = startCLI([fixtures.path('debugger/empty.js')]);
18-
19-
function onFatal(error) {
20-
cli.quit();
21-
throw error;
22-
}
23-
24-
try {
25-
(async () => {
26-
await cli.waitForInitialBreak();
27-
await cli.waitForPrompt();
28-
await cli.command('exec console.profile()');
29-
assert.match(cli.output, /undefined/);
30-
await cli.command('exec console.profileEnd()');
31-
await delay(250)
32-
assert.match(cli.output, /undefined/);
33-
assert.match(cli.output, /Captured new CPU profile\./);
34-
await cli.quit();
35-
})()
36-
.then(common.mustCall())
37-
} catch(error) {
38-
return onFatal(error)
39-
}
40-
17+
const cli = startCLI([fixtures.path('debugger/empty.js')]);
18+
19+
function onFatal(error) {
20+
cli.quit();
21+
throw error;
22+
}
23+
24+
try {
25+
(async () => {
26+
await cli.waitForInitialBreak();
27+
await cli.waitForPrompt();
28+
await cli.command('exec console.profile()');
29+
assert.match(cli.output, /undefined/);
30+
await cli.command('exec console.profileEnd()');
31+
await delay(250);
32+
assert.match(cli.output, /undefined/);
33+
assert.match(cli.output, /Captured new CPU profile\./);
34+
await cli.quit();
35+
})()
36+
.then(common.mustCall());
37+
} catch (error) {
38+
return onFatal(error);
39+
}
40+
4141
}

0 commit comments

Comments
 (0)