Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
toddw committed Apr 21, 2016
2 parents 0843e06 + d31aeeb commit 3e9f534
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
11 changes: 8 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ npm install && npm run react:14
```


### Switching between React 0.14 and React 0.13
### Switching between React 15, React 0.14 and React 0.13

```bash
# switch to React 0.13
Expand All @@ -34,6 +34,11 @@ npm run react:13
npm run react:14
```

```bash
# switch to React 15
npm run react:15
```


### Running Tests

Expand Down Expand Up @@ -86,8 +91,8 @@ Before you submit a pull request from your forked repo, check that it meets thes
1. If the pull request fixes a bug, it should include tests that fail without the changes, and pass
with them.
1. If the pull request adds functionality, the docs should be updated as part of the same PR.
1. The pull request should work for both React 0.14 and React 0.13. The CI server should run the
tests in both versions automatically when you push the PR, but if you'd like to check locally, you
1. The pull request should work for React 15, React 0.14 and React 0.13. The CI server should run the
tests in all versions automatically when you push the PR, but if you'd like to check locally, you
can do so (see above).
1. Please rebase and resolve all conflicts before submitting.

2 changes: 1 addition & 1 deletion docs/api/mount.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Returns whether or not any of the nodes in the wrapper pass the provided predica
Returns whether or not all of the nodes in the wrapper match the provided selector.

#### [`.everyWhere(predicate) => Boolean`](/docs/api/ReactWrapper/everyWhere.md)
Returns whether or not any of the nodes in the wrapper pass the provided predicate function.
Returns whether or not all of the nodes in the wrapper pass the provided predicate function.

#### [`.ref(refName) => ReactWrapper`](/docs/api/ReactWrapper/ref.md)
Returns a wrapper of the node that matches the provided reference name.
Expand Down
2 changes: 2 additions & 0 deletions docs/guides/browserify.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ In your browserify configuration, you simply need to make sure that the followin
labeled as "external", which means they will be ignored:

```
react/addons
react/lib/ReactContext
react/lib/ExecutionEnvironment
```
Expand All @@ -26,6 +27,7 @@ var browserify = require('browserify');
var b = browserify();

// make sure to mark these as external!
b.external('react/addons');
b.external('react/lib/ReactContext');
b.external('react/lib/ExecutionEnvironment');

Expand Down
2 changes: 2 additions & 0 deletions docs/guides/karma.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ webpack: { //kind of a copy of your webpack config
},
externals: {
'cheerio': 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
}
Expand All @@ -49,6 +50,7 @@ browserify: {
],
configure: function(bundle) {
bundle.on('prebundle', function() {
bundle.external('react/addons');
bundle.external('react/lib/ReactContext');
bundle.external('react/lib/ExecutionEnvironment');
});
Expand Down
14 changes: 14 additions & 0 deletions docs/guides/webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ react-dom/server
react-addons-test-utils
```

## React 15 Compatability

If you are using React 15, your config should include these externals:

```js
/* webpack.config.js */
// ...
externals: {
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
}
// ...
```

## Example Projects

Expand Down
6 changes: 6 additions & 0 deletions test/ShallowWrapper-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,15 @@ describe('shallow', () => {
const wrapper = shallow(
<div>
<input className="foo" />
<button className="bar">Button</button>
<textarea className="magic"></textarea>
<select className="reality"></select>
</div>
);
expect(wrapper.find('input').props().className).to.equal('foo');
expect(wrapper.find('button').props().className).to.equal('bar');
expect(wrapper.find('textarea').props().className).to.equal('magic');
expect(wrapper.find('select').props().className).to.equal('reality');
});

it('should find a component based on a constructor', () => {
Expand Down

0 comments on commit 3e9f534

Please sign in to comment.