| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -245,12 +245,10 @@ const { setInterval } = timerPromises; | |||
| 245 | 245 | ||
| 246 | 246 | (async () => { | |
| 247 | 247 | const signal = AbortSignal.abort('boom'); | |
| 248 | - try { | ||
| 248 | + await assert.rejects(async () => { | ||
| 249 | 249 | const iterable = timerPromises.setInterval(2, undefined, { signal }); | |
| 250 | + | ||
| 250 | 251 | // eslint-disable-next-line no-unused-vars, no-empty | |
| 251 | 252 | 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'); | ||
| 256 | 254 | })().then(common.mustCall()); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments