Skip to content

Drop dependency on mocha-jsdom in favor of explicit solution #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"clean": "rimraf lib dist coverage",
"lint": "eslint src test",
"prepublish": "npm run clean && npm run build",
"test": "mocha --compilers js:babel/register --recursive",
"test": "mocha --compilers js:babel/register --recursive --require ./test/setup.js",
"test:watch": "npm test -- --watch",
"test:cov": "babel-node ./node_modules/isparta/bin/isparta cover ./node_modules/mocha/bin/_mocha -- --recursive"
},
Expand Down Expand Up @@ -49,7 +49,6 @@
"istanbul": "^0.3.17",
"jsdom": "~5.4.3",
"mocha": "^2.2.5",
"mocha-jsdom": "~0.4.0",
"react": "^0.14.0",
"react-addons-test-utils": "^0.14.0",
"react-dom": "^0.14.0",
Expand Down
3 changes: 0 additions & 3 deletions test/components/Provider.spec.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import expect from 'expect';
import jsdom from 'mocha-jsdom';
import React, { PropTypes, Component } from 'react';
import TestUtils from 'react-addons-test-utils';
import { createStore } from 'redux';
import { Provider } from '../../src/index';

describe('React', () => {
describe('Provider', () => {
jsdom();

class Child extends Component {
static contextTypes = {
store: PropTypes.object.isRequired
Expand Down
3 changes: 0 additions & 3 deletions test/components/connect.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import expect from 'expect';
import jsdom from 'mocha-jsdom';
import React, { createClass, Children, PropTypes, Component } from 'react';
import ReactDOM from 'react-dom';
import TestUtils from 'react-addons-test-utils';
Expand All @@ -8,8 +7,6 @@ import { connect } from '../../src/index';

describe('React', () => {
describe('connect', () => {
jsdom();

class Passthrough extends Component {
render() {
return <div {...this.props} />;
Expand Down
5 changes: 5 additions & 0 deletions test/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { jsdom } from 'jsdom';

global.document = jsdom('<!doctype html><html><body></body></html>');
global.window = document.defaultView;
global.navigator = global.window.navigator;