From c9cc13f3d0f13847a2c824f76055f2f1bb1e8ca8 Mon Sep 17 00:00:00 2001 From: guyfedwards Date: Fri, 14 Sep 2018 12:35:39 +0100 Subject: [PATCH 1/3] update jest, jest-styled-components, babel-jest jest@23.6.0 jest-styled-componetns@6.2.0 babel-jest@23.6.0 prerequisite for #372 --- package.json | 7 +- src/components/Code/Code.test.js | 5 +- .../Code/__snapshots__/Code.test.js.snap | 18 +- .../__snapshots__/DataTable.test.js.snap | 1 - src/components/Input/Input.test.js | 7 +- .../Input/__snapshots__/Input.test.js.snap | 6 +- .../Search/__snapshots__/Search.test.js.snap | 16 +- yarn.lock | 1432 +++++++++-------- 8 files changed, 810 insertions(+), 682 deletions(-) diff --git a/package.json b/package.json index 52437ef2..a6c01326 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "babel-cli": "^6.18.0", "babel-core": "6.18.2", "babel-eslint": "8.2.1", - "babel-jest": "^17.0.2", + "babel-jest": "23.6.0", "babel-loader": "6.2.8", "babel-plugin-lodash": "^3.3.2", "babel-plugin-styled-components": "^1.3.0", @@ -95,9 +95,8 @@ "font-awesome-webpack": "0.0.4", "highlight.js": "9.12.0", "html-webpack-plugin": "2.24.1", - "jest": "20.0.4", - "jest-cli": "19.0.2", - "jest-styled-components": "4.4.1", + "jest": "23.6.0", + "jest-styled-components": "6.2.0", "json-loader": "0.5.4", "less": "2.7.2", "lodash": "4.17.10", diff --git a/src/components/Code/Code.test.js b/src/components/Code/Code.test.js index 5daee57a..2e0e6f9f 100644 --- a/src/components/Code/Code.test.js +++ b/src/components/Code/Code.test.js @@ -1,13 +1,10 @@ import React from 'react'; -import enzyme, { shallow, mount } from 'enzyme'; -import Adapter from 'enzyme-adapter-react-16'; +import { shallow, mount } from 'enzyme'; import { withTheme } from '../../utils/theme'; import Code from '.'; -enzyme.configure({ adapter: new Adapter() }); - document.execCommand = () => {}; document.getSelection = () => ({ toString: () => '', diff --git a/src/components/Code/__snapshots__/Code.test.js.snap b/src/components/Code/__snapshots__/Code.test.js.snap index 8c43c661..584c03f7 100644 --- a/src/components/Code/__snapshots__/Code.test.js.snap +++ b/src/components/Code/__snapshots__/Code.test.js.snap @@ -40,21 +40,21 @@ exports[` should render multi line function correctly with multiCommand= > sudo curl -l git.io/scope -o /usr/local/bin/scope - + sudo chmod a+x /usr/local/bin/scope - + scope launch https://yjsjsubdx1h8un1f858gp7to8d51zdre@frontend.dev.weave.works - + @@ -86,7 +86,7 @@ exports[` should render multi line jsx correctly with multiCommand=true sudo curl -L git.io/scope -o /usr/local/bin/scope - + should render multi line jsx correctly with multiCommand=true sudo chmod a+x /usr/local/bin/scope - + should render multi line jsx correctly with multiCommand=true https://yjsjsubdx1h8un1f858gp7to8d51zdre@frontend.dev.weave.works - + @@ -136,21 +136,21 @@ exports[` should render multi line string correctly with multiCommand=tr > sudo curl -l git.io/scope -o /usr/local/bin/scope - + sudo chmod a+x /usr/local/bin/scope - + scope launch https://yjsjsubdx1h8un1f858gp7to8d51zdre@frontend.dev.weave.works - + diff --git a/src/components/DataTable/__snapshots__/DataTable.test.js.snap b/src/components/DataTable/__snapshots__/DataTable.test.js.snap index 64ddc267..8209b2be 100644 --- a/src/components/DataTable/__snapshots__/DataTable.test.js.snap +++ b/src/components/DataTable/__snapshots__/DataTable.test.js.snap @@ -49,7 +49,6 @@ exports[`DataTable snapshots renders an element instead of a label 1`] = ` ', () => { let props; let wrapper; @@ -66,6 +63,8 @@ describe('', () => { it('should remove validation message from the DOM when hideValidationMessage=true', () => { props = { hideValidationMessage: true, + // https://github.com/styled-components/jest-styled-components/issues/189 + message: 'Derp!', }; wrapper = mount(withTheme()); diff --git a/src/components/Input/__snapshots__/Input.test.js.snap b/src/components/Input/__snapshots__/Input.test.js.snap index 92d16a6c..4a8c439c 100644 --- a/src/components/Input/__snapshots__/Input.test.js.snap +++ b/src/components/Input/__snapshots__/Input.test.js.snap @@ -266,7 +266,7 @@ exports[` should render correctly 1`] = ` should render correctly 1`] = ` inputRef={[Function]} label="Hi" message="Doh!" - onChange={[Function]} + onChange={[MockFunction]} textarea={false} valid={false} > @@ -294,7 +294,7 @@ exports[` should render correctly 1`] = ` className="c1" > snapshots renders a group of terms 1`] = `
-