Skip to content

Commit 2266430

Browse files
fix another unhandled promise
Signed-off-by: nkomonen-amazon <[email protected]>
1 parent ecb2768 commit 2266430

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/core/src/test/notifications/controller.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,9 @@ describe('RemoteFetcher', function () {
535535
httpStub.throws(new Error('network error'))
536536

537537
// Start function under test
538-
const fetcher = new RemoteFetcher().fetch('startUp', 'any').then(() => assert.fail('Did not throw exception.'))
538+
const fetcher = assert.rejects(new RemoteFetcher().fetch('startUp', 'any'), (e) => {
539+
return e instanceof Error && e.message === 'last error'
540+
})
539541

540542
// Progresses the clock, allowing the fetcher logic to break out of sleep for each iteration of withRetries()
541543
assert.strictEqual(httpStub.callCount, 1) // 0
@@ -550,9 +552,7 @@ describe('RemoteFetcher', function () {
550552
assert.strictEqual(httpStub.callCount, 5) // 150_000
551553

552554
// We hit timeout so the last error will be thrown
553-
await assert.rejects(fetcher, (e) => {
554-
return e instanceof Error && e.message === 'last error'
555-
})
555+
await fetcher
556556
})
557557
})
558558

0 commit comments

Comments
 (0)