diff --git a/src/__tests__/to-have-text-content.js b/src/__tests__/to-have-text-content.js index a8d4ef2c..8874c680 100644 --- a/src/__tests__/to-have-text-content.js +++ b/src/__tests__/to-have-text-content.js @@ -83,12 +83,12 @@ describe('.toHaveTextContent', () => { ) }) - test('when matching with empty string and element with content suggest using toBeEmpty instead', () => { + test('when matching with empty string and element with content, suggest using toBeEmptyDOMElement instead', () => { // https://github.com/testing-library/jest-dom/issues/104 const {container} = render('not empty') expect(() => expect(container.querySelector('span')).toHaveTextContent(''), - ).toThrowError(/toBeEmpty()/) + ).toThrowError(/toBeEmptyDOMElement\(\)/) }) }) diff --git a/src/to-have-text-content.js b/src/to-have-text-content.js index 9c480100..1b07909b 100644 --- a/src/to-have-text-content.js +++ b/src/to-have-text-content.js @@ -25,7 +25,7 @@ export function toHaveTextContent( '', ), checkingWithEmptyString - ? `Checking with empty string will always match, use .toBeEmpty() instead` + ? `Checking with empty string will always match, use .toBeEmptyDOMElement() instead` : `Expected element ${to} have text content`, checkWith, 'Received',