diff --git a/docs/api/mount.md b/docs/api/mount.md index 668136399..f48d7e1c5 100644 --- a/docs/api/mount.md +++ b/docs/api/mount.md @@ -165,25 +165,25 @@ Iterates through each node of the current wrapper and executes the provided func #### [`.map(fn) => Array`](ReactWrapper/map.md) Maps the current array of nodes to another array. -#### [`reduce(fn[, initialValue]) => Any`](/docs/api/ReactWrapper/reduce.md) +#### [`.reduce(fn[, initialValue]) => Any`](/docs/api/ReactWrapper/reduce.md) Reduces the current array of nodes to a value -#### [`reduceRight(fn[, initialValue]) => Any`](/docs/api/ReactWrapper/reduceRight.md) +#### [`.reduceRight(fn[, initialValue]) => Any`](/docs/api/ReactWrapper/reduceRight.md) Reduces the current array of nodes to a value, from right to left. -#### [`some(selector) => Boolean`](/docs/api/ReactWrapper/some.md) +#### [`.some(selector) => Boolean`](/docs/api/ReactWrapper/some.md) Returns whether or not any of the nodes in the wrapper match the provided selector. -#### [`someWhere(predicate) => Boolean`](/docs/api/ReactWrapper/someWHere.md) +#### [`.someWhere(predicate) => Boolean`](/docs/api/ReactWrapper/someWHere.md) Returns whether or not any of the nodes in the wrapper pass the provided predicate function. -#### [`every(selector) => Boolean`](/docs/api/ReactWrapper/every.md) +#### [`.every(selector) => Boolean`](/docs/api/ReactWrapper/every.md) Returns whether or not all of the nodes in the wrapper match the provided selector. -#### [`everyWhere(selector) => Boolean`](/docs/api/ReactWrapper/everyWhere.md) +#### [`.everyWhere(predicate) => Boolean`](/docs/api/ReactWrapper/everyWhere.md) Returns whether or not any of the nodes in the wrapper pass the provided predicate function. -#### [`ref(refName) => ReactWrapper`](/docs/api/ReactWrapper/ref.md) +#### [`.ref(refName) => ReactWrapper`](/docs/api/ReactWrapper/ref.md) Returns a wrapper of the node that matches the provided reference name. #### [`.detach() => void`](ReactWrapper/detach.md) diff --git a/docs/api/shallow.md b/docs/api/shallow.md index 8c13c96cc..cb9c838f7 100644 --- a/docs/api/shallow.md +++ b/docs/api/shallow.md @@ -163,20 +163,20 @@ Iterates through each node of the current wrapper and executes the provided func #### [`.map(fn) => Array`](ShallowWrapper/map.md) Maps the current array of nodes to another array. -#### [`reduce(fn[, initialValue]) => Any`](/docs/api/ShallowWrapper/reduce.md) +#### [`.reduce(fn[, initialValue]) => Any`](/docs/api/ShallowWrapper/reduce.md) Reduces the current array of nodes to a value -#### [`reduceRight(fn[, initialValue]) => Any`](/docs/api/ShallowWrapper/reduceRight.md) +#### [`.reduceRight(fn[, initialValue]) => Any`](/docs/api/ShallowWrapper/reduceRight.md) Reduces the current array of nodes to a value, from right to left. -#### [`some(selector) => Boolean`](/docs/api/ShallowWrapper/some.md) +#### [`.some(selector) => Boolean`](/docs/api/ShallowWrapper/some.md) Returns whether or not any of the nodes in the wrapper match the provided selector. -#### [`someWhere(predicate) => Boolean`](/docs/api/ShallowWrapper/someWhere.md) +#### [`.someWhere(predicate) => Boolean`](/docs/api/ShallowWrapper/someWhere.md) Returns whether or not any of the nodes in the wrapper pass the provided predicate function. -#### [`every(selector) => Boolean`](/docs/api/ShallowWrapper/every.md) +#### [`.every(selector) => Boolean`](/docs/api/ShallowWrapper/every.md) Returns whether or not all of the nodes in the wrapper match the provided selector. -#### [`everyWhere(selector) => Boolean`](/docs/api/ShallowWrapper/everyWhere.md) +#### [`.everyWhere(predicate) => Boolean`](/docs/api/ShallowWrapper/everyWhere.md) Returns whether or not all of the nodes in the wrapper pass the provided predicate function. 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/docs/guides/karma.md b/docs/guides/karma.md index 5002abfef..b72ae1d0c 100644 --- a/docs/guides/karma.md +++ b/docs/guides/karma.md @@ -1,7 +1,7 @@ # Using Enzyme with Karma Karma is a popular test runner that can run tests in browser environments. Enzyme is compatible with -enzyme, but often requires a little bit of configuration. +Karma, but often requires a little bit of configuration. This configuration largely depends on which plugins you are using to bundle your JavaScript code. In the case of Browserify or Webpack, see the below documentation in order to get these up and running. 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 7108c038d..76a82c653 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 89c286b92..3e705bab4 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,