diff --git a/package.json b/package.json index 54b794e0..601e1e62 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,8 @@ "react/prop-types": "off", "react/no-adjacent-inline-elements": "off", "import/no-unassigned-import": "off", - "import/named": "off" + "import/named": "off", + "testing-library/no-dom-import": "off" } }, "eslintIgnore": [ diff --git a/src/__tests__/auto-cleanup.js b/src/__tests__/auto-cleanup.js index 1d0a7954..19a5d082 100644 --- a/src/__tests__/auto-cleanup.js +++ b/src/__tests__/auto-cleanup.js @@ -9,5 +9,5 @@ test('first', () => { }) test('second', () => { - expect(document.body.innerHTML).toEqual('') + expect(document.body).toBeEmpty() }) diff --git a/src/__tests__/cleanup.js b/src/__tests__/cleanup.js index a870a42d..a9a4831f 100644 --- a/src/__tests__/cleanup.js +++ b/src/__tests__/cleanup.js @@ -18,7 +18,7 @@ test('cleans up the document', async () => { render() await cleanup() - expect(document.body.innerHTML).toBe('') + expect(document.body).toBeEmpty() expect(spy).toHaveBeenCalledTimes(1) }) diff --git a/src/__tests__/debug.js b/src/__tests__/debug.js index 088385b7..14c0779a 100644 --- a/src/__tests__/debug.js +++ b/src/__tests__/debug.js @@ -49,4 +49,8 @@ test('allows same arguments as prettyDOM', () => { `) }) -/* eslint no-console:0 */ +/* +eslint + no-console: "off", + testing-library/no-debug: "off", +*/ diff --git a/src/__tests__/multi-base.js b/src/__tests__/multi-base.js index c45bcd37..06ad0902 100644 --- a/src/__tests__/multi-base.js +++ b/src/__tests__/multi-base.js @@ -37,3 +37,9 @@ test('baseElement isolates trees from one another', () => { 'Unable to find an element with the text: Hyde.', ) }) + +// https://github.com/testing-library/eslint-plugin-testing-library/issues/188 +/* +eslint + testing-library/prefer-screen-queries: "off", +*/ diff --git a/src/__tests__/stopwatch.js b/src/__tests__/stopwatch.js index a9869ec4..882a0888 100644 --- a/src/__tests__/stopwatch.js +++ b/src/__tests__/stopwatch.js @@ -47,7 +47,7 @@ test('unmounts a component', async () => { // hey there reader! You don't need to have an assertion like this one // this is just me making sure that the unmount function works. // You don't need to do this in your apps. Just rely on the fact that this works. - expect(container.innerHTML).toBe('') + expect(container).toBeEmpty() // just wait to see if the interval is cleared or not // if it's not, then we'll call setState on an unmounted component // and get an error.