Skip to content

Commit d507ec7

Browse files
committed
Merge pull request #15 from Legitcode/feature/react-14
Waiting for react .14 :)
2 parents 80da711 + d2ae202 commit d507ec7

File tree

16 files changed

+22
-108
lines changed

16 files changed

+22
-108
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"react/no-multi-comp": 1,
3434
"react/no-unknown-property": 1,
3535
"react/prop-types": 0,
36-
"react/react-in-jsx-scope": 1,
36+
"react/react-in-jsx-scope": 0,
3737
"react/self-closing-comp": 1,
3838
"react/sort-comp": 1,
3939
"react/wrap-multilines": 1,

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "legit-tests",
3-
"version": "0.5.2",
3+
"version": "0.6.0",
44
"description": "a chainable testing library for React",
55
"main": "legit-tests.js",
66
"scripts": {
@@ -28,25 +28,27 @@
2828
},
2929
"homepage": "https://github.com/legitcode/tests#readme",
3030
"devDependencies": {
31-
"alt": "^0.17.3",
31+
"alt": "^0.17.4",
3232
"babel": "^5.8.23",
3333
"babel-core": "^5.8.25",
3434
"babel-eslint": "^4.1.3",
3535
"babel-loader": "^5.3.2",
3636
"babel-runtime": "^5.8.25",
3737
"chai": "^3.3.0",
38-
"eslint": "^1.5.1",
39-
"eslint-plugin-react": "^3.4.2",
40-
"expect": "^1.10.0",
38+
"eslint": "^1.6.0",
39+
"eslint-plugin-react": "^3.5.1",
40+
"expect": "^1.12.0",
4141
"harmony-reflect": "^1.4.2",
4242
"mocha": "^2.3.3",
4343
"mocha-babel": "^3.0.0",
4444
"react-hot-loader": "^1.3.0",
45-
"sinon": "^1.17.0",
45+
"sinon": "^1.17.1",
4646
"webpack": "^1.12.2"
4747
},
4848
"dependencies": {
4949
"jsdom": "^6.5.1",
50-
"react": "^0.13.3"
50+
"react": "^0.14.0",
51+
"react-addons-test-utils": "^0.14.0",
52+
"react-dom": "^0.14.0"
5153
}
5254
}

src/middleware/find.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react'
2-
let { TestUtils } = React.addons
1+
import TestUtils from 'react-addons-test-utils'
32

43
export default function find(selector){
4+
55
let elements, name
66
if (!(typeof selector === "string")) {
77
name = selector.name.toLowerCase()

src/middleware/simulate.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import React from 'react'
2-
let { TestUtils } = React.addons
1+
import TestUtils from 'react-addons-test-utils'
32

43
export default function simulate(data) {
54
let element

src/tests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react/addons'
2-
let { TestUtils } = React.addons
1+
import TestUtils from 'react-addons-test-utils'
2+
import ReactDOMServer from 'react-dom/server'
3+
import React from 'react'
34
global.React = React
4-
require('react/lib/ExecutionEnvironment').canUseDOM = true
55

66
import { Find, SetState, Simulate } from './middleware'
77

@@ -59,7 +59,7 @@ function Test(component, config) {
5959
return this
6060
},
6161
renderToString(callback) {
62-
const componentString = React.renderToStaticMarkup(component)
62+
const componentString = ReactDOMServer.renderToStaticMarkup(component)
6363
callback.call(null, componentString)
6464
return this
6565
}

tests/components/component.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default class TestComponent extends Component {
99

1010
render(){
1111
return (
12-
<body>
12+
<section>
1313
<div onClick={this.props.onClick}>{this.state.test}</div>
1414
<p className="box">found me!</p>
1515
<button
@@ -23,7 +23,7 @@ export default class TestComponent extends Component {
2323
Click Me
2424
</button>
2525
<TinyComponent test="true"/>
26-
</body>
26+
</section>
2727
)
2828
}
2929
}

tests/element.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from 'react'
2-
31
import Test from '../src/legit-tests'
42
import { expect } from 'chai'
53

tests/find.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from 'react'
2-
31
import Test from '../src/legit-tests'
42
import { Find } from '../src/middleware'
53
import { expect } from 'chai'
@@ -25,7 +23,7 @@ describe('Find middleware', () => {
2523
Test(<TestComponent/>)
2624
.use(Find, '.box')
2725
.test(({box}) => {
28-
expect(box.props.children).to.be.equal('found me!')
26+
expect(box.innerHTML).to.be.equal('found me!')
2927
})
3028

3129
})

tests/mixin.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from 'react'
2-
31
import Test from '../src/legit-tests'
42
import { Find } from '../src/middleware'
53
import { expect } from 'chai'

tests/no-dom.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from 'react'
2-
31
import Test from '../src/no-dom'
42
import { expect } from 'chai'
53

0 commit comments

Comments
 (0)