mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
[react-packager] Fix jest tests
This commit is contained in:
5
jestSupport/env.js
Normal file
5
jestSupport/env.js
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
global.setImmediate = global.setImmediate || function(fn) {
|
||||
return setTimeout(fn, 0);
|
||||
};
|
||||
@@ -10,6 +10,10 @@ module.exports = {
|
||||
transformSource: transformSource,
|
||||
|
||||
process: function(src, fileName) {
|
||||
if (fileName.match(/node_modules/)) {
|
||||
return src;
|
||||
}
|
||||
|
||||
try {
|
||||
return transformSource(src);
|
||||
} catch(e) {
|
||||
|
||||
@@ -8,12 +8,15 @@
|
||||
},
|
||||
"jest": {
|
||||
"scriptPreprocessor": "jestSupport/scriptPreprocess.js",
|
||||
"setupEnvScriptFile": "jestSupport/env.js",
|
||||
"testPathIgnorePatterns": [
|
||||
"/node_modules/",
|
||||
"/packager/"
|
||||
"/node_modules/"
|
||||
],
|
||||
"testFileExtensions": [
|
||||
"js"
|
||||
],
|
||||
"unmockedModulePathPatterns": [
|
||||
"source-map"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "react-packager",
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"jest": {
|
||||
"unmockedModulePathPatterns": [
|
||||
"source-map"
|
||||
],
|
||||
"testPathIgnorePatterns": [
|
||||
"JSAppServer/node_modules"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var version = require('../../package.json').version;
|
||||
var version = require('../../../../package.json').version;
|
||||
var tmpdir = require('os').tmpDir();
|
||||
var pathUtils = require('../fb-path-utils');
|
||||
var declareOpts = require('../lib/declareOpts');
|
||||
|
||||
Reference in New Issue
Block a user