Skip to content

Commit 801fcc9

Browse files
committed
Fix: Windows development
1 parent 1457ded commit 801fcc9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/jestResolver.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = (request, options) => {
3232
let files = glob.sync(request, {cwd: options.basedir});
3333
let source = '';
3434
for (let file of files) {
35-
source += `exports['${path.basename(file, '.json')}'] = require('${path.join(options.basedir, file)}');\n`;
35+
source += `exports['${path.basename(file, '.json')}'] = require('${path.join(options.basedir, file).replace(/\\/g, '\\\\')}');\n`;
3636
}
3737
let hash = crypto.createHash('md5');
3838
hash.update(source);

scripts/jest.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@
1313
const {spawn} = require('child_process');
1414

1515
let args = [...process.argv.slice(2)];
16+
let cmd = 'jest';
17+
18+
if (process.platform === 'win32') {
19+
cmd = 'cmd';
20+
args = ['/c', 'jest', ...args];
21+
}
1622

1723
process.env.NODE_ICU_DATA = 'node_modules/full-icu';
18-
let jest = spawn('jest', args, {
24+
let jest = spawn(cmd, args, {
1925
stdio: 'inherit'
2026
});
2127

0 commit comments

Comments
 (0)