Skip to content

Commit

Permalink
chore: update deprecation messages (#1534)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiller1990 committed May 7, 2020
1 parent a0ce566 commit 6e941b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/shared/util.js
Expand Up @@ -102,7 +102,7 @@ export function nextTick(): Promise<void> {

export function warnDeprecated(method: string, fallback: string = '') {
if (!config.showDeprecationWarnings) return
let msg = `${method} is deprecated and will be removed in the next major version`
if (fallback) msg += ` ${fallback}`
let msg = `${method} is deprecated and will be removed in the next major version.`
if (fallback) msg += ` ${fallback}.`
warn(msg)
}
6 changes: 4 additions & 2 deletions packages/test-utils/src/wrapper.js
Expand Up @@ -342,7 +342,8 @@ export default class Wrapper implements BaseWrapper {
isEmpty(): boolean {
warnDeprecated(
'isEmpty',
'Consider a custom matcher such as those provided in jest-dom: https://github.com/testing-library/jest-dom#tobeempty'
'Consider a custom matcher such as those provided in jest-dom: https://github.com/testing-library/jest-dom#tobeempty. ' +
'When using with findComponent, access the DOM element with findComponent(Comp).element'
)
if (!this.vnode) {
return this.element.innerHTML === ''
Expand Down Expand Up @@ -371,7 +372,8 @@ export default class Wrapper implements BaseWrapper {
isVisible(): boolean {
warnDeprecated(
'isVisible',
`Consider a custom matcher such as those provided in jest-dom: https://github.com/testing-library/jest-dom#tobevisible`
'Consider a custom matcher such as those provided in jest-dom: https://github.com/testing-library/jest-dom#tobevisible. ' +
'When using with findComponent, access the DOM element with findComponent(Comp).element'
)
let element = this.element
while (element) {
Expand Down

0 comments on commit 6e941b6

Please sign in to comment.