From 779a813ea599cd0ccdc8520f423df199753c659a Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Fri, 4 Nov 2022 13:23:48 +0100 Subject: [PATCH] Lint test suite, fix ESLint errors --- package.json | 2 +- test/test/Adapter-spec.jsx | 4 ++-- test/test/Debug-spec.jsx | 12 ++++++------ test/test/Utils-spec.jsx | 22 +++++++++++++--------- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index d8e4c7c..4588992 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "scripts": { "build": "babel --source-maps=both src -d build", "clean": "rimraf build", - "lint": "eslint src --ext .jsx,.js", + "lint": "eslint src test --ext .jsx,.js", "postinstall": "husky install", "prepack": "yarn clean && yarn build", "prettier": "prettier --check . --cache", diff --git a/test/test/Adapter-spec.jsx b/test/test/Adapter-spec.jsx index a2998b0..0f84de8 100644 --- a/test/test/Adapter-spec.jsx +++ b/test/test/Adapter-spec.jsx @@ -1151,13 +1151,13 @@ describe('Adapter', () => { describe('.wrap()', () => { it('returns a valid element', () => { - const element =
; + const element =
; const wrapped = adapter.wrap(element); expect(adapter.isValidElement(wrapped)).to.equal(true); }); it('renders the children provided', () => { - const element =
; + const element =
; const wrapped = adapter.wrap(element); expect(wrapped.props).to.contain.keys({ children: element }); }); diff --git a/test/test/Debug-spec.jsx b/test/test/Debug-spec.jsx index a44055b..ad15f51 100644 --- a/test/test/Debug-spec.jsx +++ b/test/test/Debug-spec.jsx @@ -107,9 +107,9 @@ describe('debug', () => { // FIXME: Fails for @wojtekmaj/enzyme-adapter-react-17 it.skip('renders symbol props', () => { - expect(debugElement(
)).to.equal( - '
', - ); + expect( + debugElement(
), + ).to.equal('
'); }); it('renders children on newline and indented', () => { @@ -273,9 +273,9 @@ describe('debug', () => { }); it('renders boxed primitives as the primitive', () => { - expect(debugElement(
)).to.equal( - '
', - ); + expect( + debugElement(
), + ).to.equal('
'); }); }); diff --git a/test/test/Utils-spec.jsx b/test/test/Utils-spec.jsx index 9f4f29b..24af0c9 100644 --- a/test/test/Utils-spec.jsx +++ b/test/test/Utils-spec.jsx @@ -96,9 +96,13 @@ describe('Utils', () => { }); it('tests deepEquality with object props', () => { - expect(nodeEqual(
,
)).to.equal(true); + expect( + nodeEqual(
,
), + ).to.equal(true); - expect(nodeEqual(
,
)).to.equal(false); + expect( + nodeEqual(
,
), + ).to.equal(false); }); describe('children props', () => { @@ -340,13 +344,13 @@ describe('Utils', () => { }); it('tests deepEquality with object props', () => { - expect(nodeMatches(
,
)).to.equal( - true, - ); + expect( + nodeMatches(
,
), + ).to.equal(true); - expect(nodeMatches(
,
)).to.equal( - false, - ); + expect( + nodeMatches(
,
), + ).to.equal(false); }); describe('children props', () => { @@ -417,7 +421,7 @@ describe('Utils', () => { ), ).to.equal(true); - expect(nodeMatches(
,
)).to.equal(false); + expect(nodeMatches(
,
)).to.equal(false); expect(nodeMatches(
,
{0}
)).to.equal(false); });