Skip to content

Commit

Permalink
[fixed] use the correct babel presets combination.
Browse files Browse the repository at this point in the history
  • Loading branch information
diasbruno committed Jun 16, 2017
1 parent 92ccf1d commit e921de8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 32 deletions.
20 changes: 1 addition & 19 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
{
"presets": ["react"],
"env": {
"commonjs": {
"plugins": [
"transform-class-properties",
"transform-object-rest-spread"
],
"presets": ["env"]
},
"es": {
"plugins": [
"transform-class-properties",
"transform-object-rest-spread"
],
"presets": [
["env", { "modules": false }]
]
}
}
"presets": ["es2015", "stage-2", "react"]
}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
"babel-core": "^6.25.0",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.4",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-preset-env": "^1.5.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"codeclimate-test-reporter": "^0.4.0",
"coveralls": "^2.13.1",
"cross-env": "^5.0.1",
Expand Down
20 changes: 10 additions & 10 deletions specs/Modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import expect from 'expect';
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import TestUtils from 'react-addons-test-utils';
import createReactClass from 'create-react-class';
import Modal from '../src/components/Modal';
import * as ariaAppHider from '../src/helpers/ariaAppHider';
import {
Expand Down Expand Up @@ -57,7 +56,7 @@ describe('State', () => {

it('renders into the body, not in context', () => {
const node = document.createElement('div');
const App = createReactClass({
class App extends Component {
render() {
return (
<div>
Expand All @@ -67,7 +66,7 @@ describe('State', () => {
</div>
);
}
});
}
Modal.setAppElement(node);
ReactDOM.render(<App />, node);
expect(
Expand Down Expand Up @@ -357,22 +356,23 @@ describe('State', () => {
const node = document.createElement('div');
let modal = null;

const App = createReactClass({
getInitialState() {
return { testHasChanged: false };
},
class App extends Component {
constructor(props) {
super(props);
this.state = { testHasChanged: false };
}

componentDidMount() {
expect(modal.node.className).toEqual('myPortalClass');

this.setState({
testHasChanged: true
});
},
}

componentDidUpdate() {
expect(modal.node.className).toEqual('myPortalClass-modifier');
},
}

render() {
const portalClassName = this.state.testHasChanged === true ?
Expand All @@ -389,7 +389,7 @@ describe('State', () => {
</div>
);
}
});
}

Modal.setAppElement(node);
ReactDOM.render(<App />, node);
Expand Down

0 comments on commit e921de8

Please sign in to comment.