Skip to content

Commit 58d0ae6

Browse files
committed
test: simplify test-worker-heap-profile.js
Signed-off-by: HoonDongKang <d159123@naver.com>
1 parent 13fcd6f commit 58d0ae6

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

test/parallel/test-worker-heap-profile.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,10 @@ worker.on('online', common.mustCall(async () => {
6363

6464
{
6565
const handle = await worker.startHeapProfile();
66-
try {
67-
await worker.startHeapProfile();
68-
} catch (err) {
69-
assert.strictEqual(err.code, 'ERR_HEAP_PROFILE_HAVE_BEEN_STARTED');
70-
}
66+
67+
await assert.rejects(worker.startHeapProfile(), {
68+
code: 'ERR_HEAP_PROFILE_HAVE_BEEN_STARTED',
69+
});
7170
JSON.parse(await handle.stop());
7271
}
7372

0 commit comments

Comments
 (0)