Skip to content

Commit

Permalink
fix: windows
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Sep 18, 2021
1 parent 60a796e commit 2269232
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/rules/__tests__/detectJestVersion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ const compiledFn = compileFnCode(require.resolve('../detectJestVersion.ts'));
const relativePathToFn = 'eslint-plugin-jest/lib/rules/detectJestVersion.js';

const runNodeScript = (cwd: string, script: string) => {
return spawnSync('node', ['-e', script], { cwd, encoding: 'utf-8' });
return spawnSync('node', ['-e', script.split('\n').join(' ')], {
cwd,
encoding: 'utf-8',
});
};

const runDetectJestVersion = (cwd: string) => {
return runNodeScript(
const out = runNodeScript(
cwd,
`
try {
Expand All @@ -32,6 +35,12 @@ const runDetectJestVersion = (cwd: string) => {
}
`,
);

console.log('status:', out.status);
console.log('stdout:', out.stdout);
console.log('stderr:', out.stderr);

return out;
};

/**
Expand Down

0 comments on commit 2269232

Please sign in to comment.