Skip to content

Commit

Permalink
tweak execa usage
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Aug 19, 2019
1 parent cfac2c1 commit 369e863
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion e2e/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const run = (cmd: string, cwd?: Config.Path): RunResult => {
const result = spawnSync(cmd.split(/\s/)[0], args, spawnOptions) as RunResult;

// For compat with cross-spawn
result.status = result.code;
result.status = result.exitCode;

if (result.status !== 0) {
const message = `
Expand Down
6 changes: 3 additions & 3 deletions e2e/runJest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import * as path from 'path';
import * as fs from 'fs';
import {Writable} from 'stream';
import execa, {ExecaChildProcess, ExecaReturns} from 'execa';
import execa, {ExecaChildProcess, ExecaReturnValue} from 'execa';
import stripAnsi from 'strip-ansi';
import {normalizeIcons} from './Utils';

Expand Down Expand Up @@ -53,7 +53,7 @@ function spawnJest(
args?: Array<string>,
options: RunJestOptions = {},
spawnAsync: boolean = false,
): ExecaReturns | ExecaChildProcess {
): ExecaReturnValue | ExecaChildProcess {
const isRelative = !path.isAbsolute(dir);

if (isRelative) {
Expand Down Expand Up @@ -103,7 +103,7 @@ type RunJestResult = ExecaReturns & {

function normalizeResult(result: RunJestResult, options: RunJestOptions) {
// For compat with cross-spawn
result.status = result.code;
result.status = result.exitCode;

result.stdout = normalizeIcons(result.stdout);
if (options.stripAnsi) result.stdout = stripAnsi(result.stdout);
Expand Down
6 changes: 3 additions & 3 deletions packages/jest-circus/src/__mocks__/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as fs from 'fs';
import {tmpdir} from 'os';
import * as path from 'path';
import {createHash} from 'crypto';
import {ExecaReturns, sync as spawnSync} from 'execa';
import {ExecaSyncReturnValue, sync as spawnSync} from 'execa';
import {skipSuiteOnWindows} from '@jest/test-utils';

const CIRCUS_PATH = require.resolve('../../build');
Expand All @@ -20,7 +20,7 @@ const BABEL_REGISTER_PATH = require.resolve('@babel/register');

skipSuiteOnWindows();

interface Result extends ExecaReturns {
interface Result extends ExecaSyncReturnValue {
status: number;
error: string;
}
Expand Down Expand Up @@ -58,7 +58,7 @@ export const runTest = (source: string) => {
}) as Result;

// For compat with cross-spawn
result.status = result.code;
result.status = result.exitCode;

if (result.status !== 0) {
const message = `
Expand Down

0 comments on commit 369e863

Please sign in to comment.