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 723cc9e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/rules/__tests__/detectJestVersion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import { JSONSchemaForNPMPackageJsonFiles } from '@schemastore/package';
import dedent from 'dedent';
import { create } from 'ts-node';
import { detectJestVersion } from '../detectJestVersion';

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

const runDetectJestVersion = (cwd: string) => {
return runNodeScript(
const out = runNodeScript(
cwd,
`
dedent`
try {
console.log(require('${relativePathToFn}').detectJestVersion());
} catch (error) {
console.error(error.message);
}
`,
`
.split('\n')
.join(' '),
);

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

return out;
};

/**
Expand Down

0 comments on commit 723cc9e

Please sign in to comment.