Skip to content

Commit 730710c

Browse files
committed
Merge pull request #158 from rackt/no-mocha-jsdom
Drop dependency on mocha-jsdom in favor of explicit solution
2 parents fdbc579 + 75c88e6 commit 730710c

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"clean": "rimraf lib dist coverage",
1212
"lint": "eslint src test",
1313
"prepublish": "npm run clean && npm run build",
14-
"test": "mocha --compilers js:babel/register --recursive",
14+
"test": "mocha --compilers js:babel/register --recursive --require ./test/setup.js",
1515
"test:watch": "npm test -- --watch",
1616
"test:cov": "babel-node ./node_modules/isparta/bin/isparta cover ./node_modules/mocha/bin/_mocha -- --recursive"
1717
},
@@ -49,7 +49,6 @@
4949
"istanbul": "^0.3.17",
5050
"jsdom": "~5.4.3",
5151
"mocha": "^2.2.5",
52-
"mocha-jsdom": "~0.4.0",
5352
"react": "^0.14.0",
5453
"react-addons-test-utils": "^0.14.0",
5554
"react-dom": "^0.14.0",

test/components/Provider.spec.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import expect from 'expect';
2-
import jsdom from 'mocha-jsdom';
32
import React, { PropTypes, Component } from 'react';
43
import TestUtils from 'react-addons-test-utils';
54
import { createStore } from 'redux';
65
import { Provider } from '../../src/index';
76

87
describe('React', () => {
98
describe('Provider', () => {
10-
jsdom();
11-
129
class Child extends Component {
1310
static contextTypes = {
1411
store: PropTypes.object.isRequired

test/components/connect.spec.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import expect from 'expect';
2-
import jsdom from 'mocha-jsdom';
32
import React, { createClass, Children, PropTypes, Component } from 'react';
43
import ReactDOM from 'react-dom';
54
import TestUtils from 'react-addons-test-utils';
@@ -8,8 +7,6 @@ import { connect } from '../../src/index';
87

98
describe('React', () => {
109
describe('connect', () => {
11-
jsdom();
12-
1310
class Passthrough extends Component {
1411
render() {
1512
return <div {...this.props} />;

test/setup.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { jsdom } from 'jsdom';
2+
3+
global.document = jsdom('<!doctype html><html><body></body></html>');
4+
global.window = document.defaultView;
5+
global.navigator = global.window.navigator;

0 commit comments

Comments
 (0)