mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
+1
-1
@@ -28,7 +28,7 @@
|
||||
"gulp-babel": "^5.3.0",
|
||||
"gulp-flatten": "^0.2.0",
|
||||
"gzip-js": "~0.3.2",
|
||||
"jest-cli": "^0.6.1",
|
||||
"jest-cli": "^0.9.0-fb1",
|
||||
"platform": "^1.1.0",
|
||||
"run-sequence": "^1.1.4",
|
||||
"through2": "^2.0.0",
|
||||
|
||||
@@ -51,26 +51,10 @@ module.exports = {
|
||||
!filePath.match(/\/node_modules\//) &&
|
||||
!filePath.match(/\/third_party\//)
|
||||
) {
|
||||
var rv = babel.transform(
|
||||
return babel.transform(
|
||||
src,
|
||||
Object.assign({filename: filePath}, babelOptions)
|
||||
).code;
|
||||
// hax to turn fbjs/lib/foo into /path/to/node_modules/fbjs/lib/foo
|
||||
// because jest is slooow with node_modules paths (facebook/jest#465)
|
||||
rv = rv.replace(
|
||||
/require\('(fbjs\/lib\/.+)'\)/g,
|
||||
function(call, arg) {
|
||||
return (
|
||||
'require(' +
|
||||
JSON.stringify(
|
||||
path.join(__dirname, '../../node_modules', arg)
|
||||
) +
|
||||
')'
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
return rv;
|
||||
}
|
||||
return src;
|
||||
},
|
||||
|
||||
@@ -24,7 +24,7 @@ describe('ReactDefaultPerf', function() {
|
||||
|
||||
beforeEach(function() {
|
||||
var now = 0;
|
||||
jest.setMock('performanceNow', function() {
|
||||
jest.setMock('fbjs/lib/performanceNow', function() {
|
||||
return now++;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user