From 6e941b6a8cee5f202011932eceff4518d48d93c1 Mon Sep 17 00:00:00 2001 From: Lachlan Date: Thu, 7 May 2020 21:52:38 +1000 Subject: [PATCH] chore: update deprecation messages (#1534) --- packages/shared/util.js | 4 ++-- packages/test-utils/src/wrapper.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/shared/util.js b/packages/shared/util.js index ecec28da6..9f209b8b3 100644 --- a/packages/shared/util.js +++ b/packages/shared/util.js @@ -102,7 +102,7 @@ export function nextTick(): Promise { 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) } diff --git a/packages/test-utils/src/wrapper.js b/packages/test-utils/src/wrapper.js index ed950a8c9..97faae8cb 100644 --- a/packages/test-utils/src/wrapper.js +++ b/packages/test-utils/src/wrapper.js @@ -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 === '' @@ -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) {