Skip to content

Commit

Permalink
add note about find queries being preferred
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Mar 4, 2020
1 parent 393ba2f commit a00cc96
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
Original file line number Diff line number Diff line change
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 \`wait\` instead (it's the same API, so you can find/replace): https://testing-library.com/docs/dom-testing-library/api-async#wait",
"\`waitForElement\` has been deprecated. Use a \`find*\` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) or use \`wait\` instead (it's the same API, so you can find/replace): https://testing-library.com/docs/dom-testing-library/api-async#wait",
],
]
`)
Expand Down
2 changes: 1 addition & 1 deletion src/wait-for-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async function waitForElement(callback, options) {
if (!hasWarned) {
hasWarned = true
console.warn(
`\`waitForElement\` has been deprecated. Use \`wait\` instead (it's the same API, so you can find/replace): https://testing-library.com/docs/dom-testing-library/api-async#wait`,
`\`waitForElement\` has been deprecated. Use a \`find*\` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) or use \`wait\` instead (it's the same API, so you can find/replace): https://testing-library.com/docs/dom-testing-library/api-async#wait`,
)
}
if (!callback) {
Expand Down

0 comments on commit a00cc96

Please sign in to comment.