Skip to content

Commit

Permalink
fix: misleading advice in waitForElement deprecation warning (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
pelotom committed May 27, 2020
1 parent f2165a3 commit b641e8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/wait-for-element.js
Expand Up @@ -22,7 +22,7 @@ test('waits for element to appear in the document', async () => {
expect(console.warn.mock.calls).toMatchInlineSnapshot(`
Array [
Array [
"\`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",
"\`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",
],
]
`)
Expand Down
2 changes: 1 addition & 1 deletion src/wait-for-element.js
Expand Up @@ -9,7 +9,7 @@ async function waitForElement(callback, options) {
if (!hasWarned) {
hasWarned = true
console.warn(
`\`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`,
`\`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`,
)
}
if (!callback) {
Expand Down

0 comments on commit b641e8d

Please sign in to comment.