From edaf1b42a6984c5c58965fb1aad53177d00a3f36 Mon Sep 17 00:00:00 2001 From: HaNdTriX Date: Fri, 17 Aug 2018 20:20:56 +0200 Subject: [PATCH] Fix with-jest example (#4978) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Running the [with-jest](https://github.com/zeit/next.js/tree/canary/examples/with-jest) example results in the following error: ```log FAIL __tests__/index.test.js ● Test suite failed to run SecurityError: localStorage is not available for opaque origins at Window.get localStorage [as localStorage] (node_modules/jsdom/lib/jsdom/browser/Window.js:257:15) at Array.forEach () Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total Time: 0.943s Ran all test suites. error Command failed with exit code 1. ``` Upgrading the dependencies (jest) to the latest version helps! [More info](https://github.com/jsdom/jsdom/issues/2304) Related #4776 --- examples/with-jest/package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/with-jest/package.json b/examples/with-jest/package.json index de69bb4ce16be..f471349c78ad5 100644 --- a/examples/with-jest/package.json +++ b/examples/with-jest/package.json @@ -3,17 +3,17 @@ "version": "1.0.0", "dependencies": { "next": "latest", - "react": "16.2.0", - "react-dom": "16.2.0" + "react": "16.4.2", + "react-dom": "16.4.2" }, "devDependencies": { - "babel-core": "7.0.0-bridge.0", - "babel-jest": "22.4.3", - "enzyme": "3.2.0", - "enzyme-adapter-react-16": "1.1.1", - "jest": "22.0.1", + "@babel/core": "7.0.0-rc.1", + "babel-jest": "23.4.2", + "enzyme": "3.4.3", + "enzyme-adapter-react-16": "1.2.0", + "jest": "23.5.0", "react-addons-test-utils": "15.6.2", - "react-test-renderer": "16.2.0" + "react-test-renderer": "16.4.2" }, "scripts": { "test": "NODE_ENV=test jest",