diff --git a/docs/guides/jest.md b/docs/guides/jest.md index a8a2c75e7..a58cb8090 100644 --- a/docs/guides/jest.md +++ b/docs/guides/jest.md @@ -1,6 +1,6 @@ # Using Jest with Enzyme -If you are using Jest with enzyme and using Jest's "automocking" feature, you will need to mark +If you are using Jest with enzyme and using Jest's "automocking" feature, you will need to mark several modules to be unmocked in your `package.json`: ```js @@ -16,7 +16,6 @@ several modules to be unmocked in your `package.json`: "enzyme", "cheerio", "htmlparser2", - "underscore", "lodash", "domhandler", "object.assign", diff --git a/package.json b/package.json index bfb99aa4e..8775bc4b7 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,9 @@ "dependencies": { "cheerio": "^0.20.0", "is-subset": "^0.1.1", + "lodash": "^4.0.0", "object.assign": "^4.0.3", - "object.values": "^1.0.3", - "underscore": "^1.8.3" + "object.values": "^1.0.3" }, "devDependencies": { "babel-cli": "^6.3.17", diff --git a/src/Debug.js b/src/Debug.js index 2d16d03b9..7e263f722 100644 --- a/src/Debug.js +++ b/src/Debug.js @@ -13,7 +13,9 @@ import { import { propsOfNode, } from './Utils'; -import { without, escape, compact } from 'underscore'; +import without from 'lodash/without'; +import escape from 'lodash/escape'; +import compact from 'lodash/compact'; import { REACT013, REACT014 } from './version'; import objectValues from 'object.values'; diff --git a/src/MountedTraversal.js b/src/MountedTraversal.js index 490bd2aef..dfded23c7 100644 --- a/src/MountedTraversal.js +++ b/src/MountedTraversal.js @@ -1,4 +1,4 @@ -import { isEmpty } from 'underscore'; +import isEmpty from 'lodash/isEmpty'; import isSubset from 'is-subset'; import { coercePropValue, diff --git a/src/ReactWrapper.js b/src/ReactWrapper.js index 9bc1ca1d2..e9efafd23 100644 --- a/src/ReactWrapper.js +++ b/src/ReactWrapper.js @@ -1,6 +1,8 @@ import React from 'react'; import cheerio from 'cheerio'; -import { flatten, unique, compact } from 'underscore'; +import flatten from 'lodash/flatten'; +import unique from 'lodash/uniq'; +import compact from 'lodash/compact'; import createWrapperComponent from './ReactWrapperComponent'; import { instHasClassName, diff --git a/src/ShallowTraversal.js b/src/ShallowTraversal.js index 698725937..8188fac70 100644 --- a/src/ShallowTraversal.js +++ b/src/ShallowTraversal.js @@ -1,5 +1,5 @@ import React from 'react'; -import { isEmpty } from 'underscore'; +import isEmpty from 'lodash/isEmpty'; import isSubset from 'is-subset'; import { coercePropValue, diff --git a/src/ShallowWrapper.js b/src/ShallowWrapper.js index c255fd6b0..dfd4dfa96 100644 --- a/src/ShallowWrapper.js +++ b/src/ShallowWrapper.js @@ -1,5 +1,7 @@ import React from 'react'; -import { flatten, unique, compact } from 'underscore'; +import flatten from 'lodash/flatten'; +import unique from 'lodash/uniq'; +import compact from 'lodash/compact'; import cheerio from 'cheerio'; import { nodeEqual,