Skip to content

Commit 6fe2000

Browse files
committed
update error message
1 parent a1343c6 commit 6fe2000

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,31 +49,31 @@ test('requires an element to exist first', () => {
4949
return expect(
5050
waitForElementToBeRemoved(null),
5151
).rejects.toThrowErrorMatchingInlineSnapshot(
52-
`"The callback function which was passed did not return an element or non-empty array of elements. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
52+
`"The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
5353
)
5454
})
5555

5656
test('requires an unempty array of elements to exist first', () => {
5757
return expect(
5858
waitForElementToBeRemoved([]),
5959
).rejects.toThrowErrorMatchingInlineSnapshot(
60-
`"The callback function which was passed did not return an element or non-empty array of elements. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
60+
`"The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
6161
)
6262
})
6363

6464
test('requires an element to exist first (function form)', () => {
6565
return expect(
6666
waitForElementToBeRemoved(() => null),
6767
).rejects.toThrowErrorMatchingInlineSnapshot(
68-
`"The callback function which was passed did not return an element or non-empty array of elements. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
68+
`"The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
6969
)
7070
})
7171

7272
test('requires an unempty array of elements to exist first (function form)', () => {
7373
return expect(
7474
waitForElementToBeRemoved(() => []),
7575
).rejects.toThrowErrorMatchingInlineSnapshot(
76-
`"The callback function which was passed did not return an element or non-empty array of elements. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
76+
`"The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal."`,
7777
)
7878
})
7979

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const isRemoved = result => !result || (Array.isArray(result) && !result.length)
77
function initialCheck(elements) {
88
if (isRemoved(elements)) {
99
throw new Error(
10-
'The callback function which was passed did not return an element or non-empty array of elements. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.',
10+
'The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.',
1111
)
1212
}
1313
}

0 commit comments

Comments
 (0)