Skip to content

Commit 6e941b6

Browse files
authored
chore: update deprecation messages (vuejs#1534)
1 parent a0ce566 commit 6e941b6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/shared/util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function nextTick(): Promise<void> {
102102

103103
export function warnDeprecated(method: string, fallback: string = '') {
104104
if (!config.showDeprecationWarnings) return
105-
let msg = `${method} is deprecated and will be removed in the next major version`
106-
if (fallback) msg += ` ${fallback}`
105+
let msg = `${method} is deprecated and will be removed in the next major version.`
106+
if (fallback) msg += ` ${fallback}.`
107107
warn(msg)
108108
}

packages/test-utils/src/wrapper.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ export default class Wrapper implements BaseWrapper {
342342
isEmpty(): boolean {
343343
warnDeprecated(
344344
'isEmpty',
345-
'Consider a custom matcher such as those provided in jest-dom: https://github.com/testing-library/jest-dom#tobeempty'
345+
'Consider a custom matcher such as those provided in jest-dom: https://github.com/testing-library/jest-dom#tobeempty. ' +
346+
'When using with findComponent, access the DOM element with findComponent(Comp).element'
346347
)
347348
if (!this.vnode) {
348349
return this.element.innerHTML === ''
@@ -371,7 +372,8 @@ export default class Wrapper implements BaseWrapper {
371372
isVisible(): boolean {
372373
warnDeprecated(
373374
'isVisible',
374-
`Consider a custom matcher such as those provided in jest-dom: https://github.com/testing-library/jest-dom#tobevisible`
375+
'Consider a custom matcher such as those provided in jest-dom: https://github.com/testing-library/jest-dom#tobevisible. ' +
376+
'When using with findComponent, access the DOM element with findComponent(Comp).element'
375377
)
376378
let element = this.element
377379
while (element) {

0 commit comments

Comments
 (0)