Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c6ef3fb

Browse filesBrowse files
committed
With correct filePath
1 parent dd267eb commit c6ef3fb
Copy full SHA for c6ef3fb

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎resources/jestPreprocessor.js

Copy file name to clipboardExpand all lines: resources/jestPreprocessor.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function compileTypeScript(filePath) {
5252
return fs.readFileSync(outputPath, {encoding: 'utf8'});
5353
}
5454

55-
function withLocalImmutable(jsSrc) {
55+
function withLocalImmutable(filePath, jsSrc) {
5656
return jsSrc.replace(
5757
/require\('immutable/g,
5858
"require('" + path.relative(path.dirname(filePath), process.cwd())
@@ -62,11 +62,11 @@ function withLocalImmutable(jsSrc) {
6262
module.exports = {
6363
process: function(src, filePath) {
6464
if (filePath.match(/\.ts$/) && !filePath.match(/\.d\.ts$/)) {
65-
return withLocalImmutable(compileTypeScript(filePath));
65+
return withLocalImmutable(filePath, compileTypeScript(filePath));
6666
}
6767

6868
if (filePath.match(/\.js$/) && ~filePath.indexOf('/__tests__/')) {
69-
return withLocalImmutable(react.transform(src, {harmony: true}));
69+
return withLocalImmutable(filePath, react.transform(src, {harmony: true}));
7070
}
7171

7272
return src;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.