From bef0759e35bda1e760ae7f036973a8db3ce4676f Mon Sep 17 00:00:00 2001 From: Julian Grinblat Date: Sun, 10 Mar 2019 15:54:11 +0900 Subject: [PATCH] Fix linting and testing --- .eslintrc.js | 1 + ...test.jsx.snap => ScrollToTop.test.js.snap} | 24 +++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) rename src/__snapshots__/{ScrollToTop.test.jsx.snap => ScrollToTop.test.js.snap} (78%) diff --git a/.eslintrc.js b/.eslintrc.js index b627f24..37cc3d0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -57,6 +57,7 @@ module.exports = { "react/forbid-component-props": [0], "react/jsx-curly-brace-presence": [0], "no-console": 1, + "no-empty-function": 0, "no-inner-declarations": 1, "no-invalid-this": 0, indent: ["error", 2], diff --git a/src/__snapshots__/ScrollToTop.test.jsx.snap b/src/__snapshots__/ScrollToTop.test.js.snap similarity index 78% rename from src/__snapshots__/ScrollToTop.test.jsx.snap rename to src/__snapshots__/ScrollToTop.test.js.snap index 8a2beb6..273ebc9 100644 --- a/src/__snapshots__/ScrollToTop.test.jsx.snap +++ b/src/__snapshots__/ScrollToTop.test.js.snap @@ -2,13 +2,13 @@ exports[`ScrollToTop renders 1`] = ` ShallowWrapper { - "length": 1, Symbol(enzyme.__root__): [Circular], Symbol(enzyme.__unrendered__): , Symbol(enzyme.__renderer__): Object { "batchedUpdates": [Function], "getNode": [Function], "render": [Function], + "simulateError": [Function], "simulateEvent": [Function], "unmount": [Function], }, @@ -40,6 +40,16 @@ ShallowWrapper { "adapter": ReactSixteenAdapter { "options": Object { "enableComponentDidUpdateOnSetState": true, + "lifecycles": Object { + "componentDidUpdate": Object { + "onSetState": true, + }, + "getDerivedStateFromProps": true, + "getSnapshotBeforeUpdate": true, + "setState": Object { + "skipsComponentDidUpdateOnNullish": true, + }, + }, }, }, }, @@ -48,7 +58,6 @@ ShallowWrapper { exports[`ScrollToTop renders children 1`] = ` ShallowWrapper { - "length": 1, Symbol(enzyme.__root__): [Circular], Symbol(enzyme.__unrendered__): @@ -57,6 +66,7 @@ ShallowWrapper { "batchedUpdates": [Function], "getNode": [Function], "render": [Function], + "simulateError": [Function], "simulateEvent": [Function], "unmount": [Function], }, @@ -104,6 +114,16 @@ ShallowWrapper { "adapter": ReactSixteenAdapter { "options": Object { "enableComponentDidUpdateOnSetState": true, + "lifecycles": Object { + "componentDidUpdate": Object { + "onSetState": true, + }, + "getDerivedStateFromProps": true, + "getSnapshotBeforeUpdate": true, + "setState": Object { + "skipsComponentDidUpdateOnNullish": true, + }, + }, }, }, },