Skip to content

Commit

Permalink
Fix haste_impl for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rubennorte committed Oct 10, 2018
1 parent 92c5e04 commit 1c1c958
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/jest-haste-map/src/__tests__/haste_impl.js
Expand Up @@ -6,19 +6,21 @@
*/
'use strict';

const path = require('path');

module.exports = {
getHasteName(path) {
getHasteName(filename) {
if (
path.includes('__mocks__') ||
path.includes('NoHaste') ||
path.includes('/module_dir/') ||
path.includes('/sourcemaps/')
filename.includes('__mocks__') ||
filename.includes('NoHaste') ||
filename.includes(path.sep + 'module_dir' + path.sep) ||
filename.includes(path.sep + 'sourcemaps' + path.sep)
) {
return undefined;
}

return path
.substr(path.lastIndexOf('/') + 1)
return filename
.substr(filename.lastIndexOf(path.sep) + 1)
.replace(/(\.(android|ios|native))?\.js$/, '');
},
};

0 comments on commit 1c1c958

Please sign in to comment.