提交 55480fbc 编写于 作者: D Dmitrii Abramov 提交者: Kyle Davis

jest@15 (#377)

上级 42feb526
......@@ -49,7 +49,7 @@
"gulp-rename": "^1.2.2",
"gulp-util": "^3.0.6",
"immutable": "^3.7.4",
"jest-cli": "^11.0.1",
"jest": "^15.1.1",
"object-assign": "^4.0.1",
"react": "^15.0.2",
"react-addons-test-utils": "^15.0.1",
......@@ -71,18 +71,14 @@
"/lib/",
"/node_modules/"
],
"persistModuleRegistryBetweenSpecs": true,
"preprocessorIgnorePatterns": [
"/node_modules/"
],
"rootDir": "",
"rootDir": "./",
"scriptPreprocessor": "scripts/jest/preprocessor.js",
"setupEnvScriptFile": "scripts/jest/environment.js",
"setupFiles": ["scripts/jest/environment.js"],
"testPathDirs": [
"<rootDir>/src"
],
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/(?!fbemitter)"
]
}
}
var assign = require('object-assign');
var babel = require('babel-core');
var babelDefaultOptions = require('../babel/default-options');
var babelOpts = babelDefaultOptions;
var babelOpts = require('../babel/default-options');
module.exports = {
process: function(src, path) {
// TODO: Use preprocessorIgnorePatterns when it works.
// See https://github.com/facebook/jest/issues/385.
if (!path.match(/\/node_modules\//) && !path.match(/\/third_party\//)) {
return babel.transform(src, assign({filename: path}, babelOpts)).code;
}
return src;
return babel.transform(src, assign({filename: path}, babelOpts)).code;
}
};
......@@ -7,9 +7,6 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
jest.dontMock('Dispatcher');
jest.dontMock('invariant');
var Dispatcher = require('Dispatcher');
describe('Dispatcher', () => {
......
......@@ -10,11 +10,6 @@
* @typechecks
*/
jest
.dontMock('Dispatcher')
.dontMock('FluxStore')
.dontMock('FluxStoreGroup');
var Dispatcher = require('Dispatcher');
var FluxStore = require('FluxStore');
var FluxStoreGroup = require('FluxStoreGroup');
......
......@@ -9,11 +9,6 @@
* @emails oncall+uiecommd
*/
jest
.dontMock('Dispatcher')
.dontMock('FluxReduceStore')
.dontMock('FluxStore');
var Dispatcher = require('Dispatcher');
var FluxReduceStore = require('FluxReduceStore');
var Immutable = require('immutable');
......@@ -48,6 +43,7 @@ describe('FluxReduceStore', () => {
var dispatcher = new Dispatcher();
store = new FooStore(dispatcher);
dispatch = dispatcher.dispatch.bind(dispatcher);
store.__emitter.emit = jest.fn();
onChange = store.__emitter.emit;
});
......
......@@ -10,9 +10,8 @@
* @typechecks
*/
jest
.dontMock('FluxStore')
.dontMock('invariant'); // This shouldn't be necessary. Not sure why it is.
jest.mock('fbemitter');
jest.mock('Dispatcher');
var FluxStore = require('FluxStore');
var Dispatcher = require('Dispatcher');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册