FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: simplify test-timers-interval-promisified.js · nodejs/node@30f1a19 · GitHub

/ node Public

Commit 30f1a19

Browse files
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 97a437e commit 30f1a19

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
@@ -245,12 +245,10 @@ const { setInterval } = timerPromises;
245245

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

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL