diff --git a/examples/with-jest/.babelrc b/examples/with-jest/.babelrc index 36be3fb8..ca67af2f 100644 --- a/examples/with-jest/.babelrc +++ b/examples/with-jest/.babelrc @@ -1,15 +1,16 @@ { "env": { "development": { - "presets": ["next/babel"] + "presets": "next/babel" }, "production": { - "presets": ["next/babel"] + "presets": "next/babel" }, "test": { - // next/babel does not transpile import/export syntax. - // So, using es2015 in the beginning will fix that. - "presets": ["es2015", "next/babel"] + "presets": [ + ["env", { "modules": "commonjs" }], + "next/babel" + ] } } } diff --git a/examples/with-jest/__tests__/__snapshots__/index.test.js.snap b/examples/with-jest/__tests__/__snapshots__/index.test.js.snap index 78ac5c93..ed68b9d1 100644 --- a/examples/with-jest/__tests__/__snapshots__/index.test.js.snap +++ b/examples/with-jest/__tests__/__snapshots__/index.test.js.snap @@ -1,8 +1,12 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + exports[`With Snapshot Testing App shows "Hello world!" 1`] = `
+ data-jsx={2648947580} +>

+ data-jsx={2648947580} + > Hello World!

diff --git a/examples/with-jest/__tests__/index.test.js b/examples/with-jest/__tests__/index.test.js index 1731d8a6..ffb2ef45 100644 --- a/examples/with-jest/__tests__/index.test.js +++ b/examples/with-jest/__tests__/index.test.js @@ -1,15 +1,14 @@ -/* global it, expect, describe */ +/* eslint-env jest */ -import React from 'react' import { shallow } from 'enzyme' +import React from 'react' import renderer from 'react-test-renderer' + import App from '../pages/index.js' describe('With Enzyme', () => { it('App shows "Hello world!"', () => { - const app = shallow( - - ) + const app = shallow() expect(app.find('p').text()).toEqual('Hello World!') }) diff --git a/examples/with-jest/package.json b/examples/with-jest/package.json index ec84a88d..457eb36c 100644 --- a/examples/with-jest/package.json +++ b/examples/with-jest/package.json @@ -2,20 +2,19 @@ "name": "with-jest", "dependencies": { "next": "latest", - "react": "^15.4.2", - "react-dom": "^15.4.2" + "react": "^15.5.4", + "react-dom": "^15.5.4" + }, + "devDependencies": { + "enzyme": "^2.8.2", + "jest": "^20.0.0", + "react-addons-test-utils": "^15.5.1", + "react-test-renderer": "^15.5.4" }, "scripts": { "test": "jest", "dev": "next", "build": "next build", "start": "next start" - }, - "devDependencies": { - "enzyme": "^2.5.1", - "jest-cli": "^18.0.0", - "react-addons-test-utils": "^15.4.2", - "babel-preset-es2015": "^6.22.0", - "react-test-renderer": "^15.4.2" } }