Skip to content

Commit 393ba2f

Browse files
committed
add coverage for wait-for-element-to-be-removed
1 parent 4a68f39 commit 393ba2f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/__tests__/wait-for-element-to-be-removed.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,18 @@ test("doesn't change jest's timers value when importing the module", () => {
117117

118118
expect(window.setTimeout._isMockFunction).toEqual(true)
119119
})
120+
121+
test('rethrows non-testing-lib errors', () => {
122+
let throwIt = false
123+
const div = document.createElement('div')
124+
const error = new Error('my own error')
125+
return expect(
126+
waitForElementToBeRemoved(() => {
127+
if (throwIt) {
128+
throw error
129+
}
130+
throwIt = true
131+
return div
132+
}),
133+
).rejects.toBe(error)
134+
})

0 commit comments

Comments
 (0)