Skip to content

Commit b641e8d

Browse files
authored
fix: misleading advice in waitForElement deprecation warning (#588)
1 parent f2165a3 commit b641e8d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/__tests__/wait-for-element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test('waits for element to appear in the document', async () => {
2222
expect(console.warn.mock.calls).toMatchInlineSnapshot(`
2323
Array [
2424
Array [
25-
"\`waitForElement\` has been deprecated. Use a \`find*\` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) or use \`waitFor\` instead (it's the same API, so you can find/replace): https://testing-library.com/docs/dom-testing-library/api-async#waitfor",
25+
"\`waitForElement\` has been deprecated. Use a \`find*\` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) or use \`waitFor\` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor",
2626
],
2727
]
2828
`)

src/wait-for-element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async function waitForElement(callback, options) {
99
if (!hasWarned) {
1010
hasWarned = true
1111
console.warn(
12-
`\`waitForElement\` has been deprecated. Use a \`find*\` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) or use \`waitFor\` instead (it's the same API, so you can find/replace): https://testing-library.com/docs/dom-testing-library/api-async#waitfor`,
12+
`\`waitForElement\` has been deprecated. Use a \`find*\` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) or use \`waitFor\` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor`,
1313
)
1414
}
1515
if (!callback) {

0 commit comments

Comments
 (0)