Skip to content

Commit 723cc9e

Browse files
committed
fix: windows
1 parent 60a796e commit 723cc9e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/rules/__tests__/detectJestVersion.test.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as fs from 'fs';
33
import * as os from 'os';
44
import * as path from 'path';
55
import { JSONSchemaForNPMPackageJsonFiles } from '@schemastore/package';
6+
import dedent from 'dedent';
67
import { create } from 'ts-node';
78
import { detectJestVersion } from '../detectJestVersion';
89

@@ -22,16 +23,24 @@ const runNodeScript = (cwd: string, script: string) => {
2223
};
2324

2425
const runDetectJestVersion = (cwd: string) => {
25-
return runNodeScript(
26+
const out = runNodeScript(
2627
cwd,
27-
`
28+
dedent`
2829
try {
2930
console.log(require('${relativePathToFn}').detectJestVersion());
3031
} catch (error) {
3132
console.error(error.message);
3233
}
33-
`,
34+
`
35+
.split('\n')
36+
.join(' '),
3437
);
38+
39+
console.log('status:', out.status);
40+
console.log('stdout:', out.stdout);
41+
console.log('stderr:', out.stderr);
42+
43+
return out;
3544
};
3645

3746
/**

0 commit comments

Comments
 (0)