Skip to content

Commit f03bcd1

Browse files
author
Amjad Masad
committed
[react-packager] Fix jest tests
1 parent 4035ccc commit f03bcd1

File tree

6 files changed

+10
-25
lines changed

6 files changed

+10
-25
lines changed

jestSupport/env.js

-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
/**
2-
* Copyright (c) 2015-present, Facebook, Inc.
3-
* All rights reserved.
4-
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
8-
*/
91
'use strict';
102

113
global.setImmediate = global.setImmediate || function(fn) {

jestSupport/scriptPreprocess.js

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ module.exports = {
1010
transformSource: transformSource,
1111

1212
process: function(src, fileName) {
13+
if (fileName.match(/node_modules/)) {
14+
return src;
15+
}
16+
1317
try {
1418
return transformSource(src);
1519
} catch(e) {

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
},
99
"jest": {
1010
"scriptPreprocessor": "jestSupport/scriptPreprocess.js",
11+
"setupEnvScriptFile": "jestSupport/env.js",
1112
"testPathIgnorePatterns": [
12-
"/node_modules/",
13-
"/packager/"
13+
"/node_modules/"
1414
],
1515
"testFileExtensions": [
1616
"js"
17+
],
18+
"unmockedModulePathPatterns": [
19+
"source-map"
1720
]
1821
},
1922
"scripts": {

packager/react-packager/,

Whitespace-only changes.

packager/react-packager/package.json

-14
This file was deleted.

packager/react-packager/src/JSTransformer/Cache.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
var path = require('path');
4-
var version = require('../../package.json').version;
4+
var version = require('../../../../package.json').version;
55
var tmpdir = require('os').tmpDir();
66
var pathUtils = require('../fb-path-utils');
77
var declareOpts = require('../lib/declareOpts');

0 commit comments

Comments
 (0)