Skip to content

Commit 01c1263

Browse files
HoonDongKangaduh95
authored andcommitted
test: simplify test-timers-interval-promisified.js
Signed-off-by: HoonDongKang <d159123@naver.com> PR-URL: #65322 Refs: #57338 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 0c4b817 commit 01c1263

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

test/parallel/test-timers-interval-promisified.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,10 @@ process.on('multipleResolves', common.mustNotCall());
247247

248248
(async () => {
249249
const signal = AbortSignal.abort('boom');
250-
try {
250+
await assert.rejects(async () => {
251251
const iterable = timerPromises.setInterval(2, undefined, { signal });
252+
252253
// eslint-disable-next-line no-unused-vars, no-empty
253254
for await (const _ of iterable) { }
254-
assert.fail('should have failed');
255-
} catch (err) {
256-
assert.strictEqual(err.cause, 'boom');
257-
}
255+
}, { cause: 'boom' }, 'should have failed');
258256
})().then(common.mustCall());

0 commit comments

Comments
 (0)