-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #240 from iancmyers/icm/react-15-compat
Add compatibility for React 15 RC1
- Loading branch information
Showing
13 changed files
with
92 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Working with React 15 | ||
|
||
If you are wanting to use Enzyme with React 0.14, but don't already have React 15 and react-dom | ||
installed, you should do so: | ||
|
||
```bash | ||
npm i --save [email protected] [email protected] | ||
``` | ||
|
||
Further, enzyme requires the test utilities addon be installed: | ||
|
||
```bash | ||
npm i --save-dev [email protected] | ||
``` | ||
|
||
Next, to get started with enzyme, you can simply install it with npm: | ||
|
||
```bash | ||
npm i --save-dev enzyme | ||
``` | ||
|
||
And then you're ready to go! In your test files you can simply `require` or `import` enzyme: | ||
|
||
ES6: | ||
```js | ||
import { shallow, mount, render } from 'enzyme'; | ||
const wrapper = shallow(<Foo />); | ||
``` | ||
|
||
ES5: | ||
```js | ||
var enzyme = require('enzyme'); | ||
var wrapper = enzyme.shallow(<Foo />); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,7 @@ fi | |
if [ "$REACT" = "0.14" ]; then | ||
npm run react:14 | ||
fi | ||
|
||
if [ "$REACT" = "15" ]; then | ||
npm run react:15 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,15 @@ | |
"check": "npm run lint && npm run test:all", | ||
"build": "babel src --out-dir build", | ||
"test": "npm run lint && npm run test:only", | ||
"test:only": "mocha --require withDom.js --compilers js:babel-core/register --recursive test/*.js", | ||
"test:single": "mocha --require withDom.js --compilers js:babel-core/register --watch", | ||
"test:watch": "mocha --require withDom.js --compilers js:babel-core/register --recursive test/*.js --watch", | ||
"test:only": "mocha --require withDom.js --compilers js:babel-core/register --recursive test/*.js --reporter dot", | ||
"test:single": "mocha --require withDom.js --compilers js:babel-core/register --watch --reporter dot", | ||
"test:watch": "mocha --require withDom.js --compilers js:babel-core/register --recursive test/*.js --watch --reporter dot", | ||
"test:env": "sh ./example-test.sh", | ||
"test:all": "npm run react:13 && npm test && npm run react:14 && npm test", | ||
"test:all": "npm run react:13 && npm test && npm run react:14 && npm test && npm run react:15 && npm test", | ||
"react:clean": "rimraf node_modules/react node_modules/react-dom node_modules/react-addons-test-utils", | ||
"react:13": "npm run react:clean && npm i [email protected]", | ||
"react:14": "npm run react:clean && npm i [email protected] [email protected] [email protected]", | ||
"react:15": "npm run react:clean && npm i [email protected] [email protected] [email protected]", | ||
"docs:clean": "rimraf _book", | ||
"docs:prepare": "gitbook install", | ||
"docs:build": "npm run docs:prepare && gitbook build", | ||
|
@@ -79,6 +80,6 @@ | |
"sinon": "^1.15.4" | ||
}, | ||
"peerDependencies": { | ||
"react": "0.13.x || 0.14.x" | ||
"react": "0.13.x || 0.14.x || 15.* || 15.0.0-rc.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters