Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump most dated deps #8850

Merged
merged 10 commits into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions e2e/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@ import * as fs from 'fs';
import * as path from 'path';
import {Config} from '@jest/types';

import {ExecaReturns, sync as spawnSync} from 'execa';
// eslint-disable-next-line import/named
import {ExecaReturnValue, sync as spawnSync} from 'execa';
import {createDirectory} from 'jest-util';
import rimraf from 'rimraf';

export type RunResult = ExecaReturns & {
interface RunResult extends ExecaReturnValue {
status: number;
error: Error;
};
}
export const run = (cmd: string, cwd?: Config.Path): RunResult => {
const args = cmd.split(/\s/).slice(1);
const spawnOptions = {cwd, preferLocal: false, reject: false};
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
4 changes: 0 additions & 4 deletions e2e/__tests__/__snapshots__/coverageThreshold.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ All files | 50 | 100 | 50 | 50 | |
apple.js | 0 | 100 | 0 | 0 | 2,3 |
banana.js | 100 | 100 | 100 | 100 | |
-----------|----------|----------|----------|----------|-------------------|

`;

exports[`exits with 0 if global threshold group is not found in coverage data: stdout 1`] = `
Expand Down Expand Up @@ -57,7 +56,6 @@ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
All files | 50 | 100 | 0 | 50 | |
not-covered.js | 50 | 100 | 0 | 50 | 3 |
----------------|----------|----------|----------|----------|-------------------|

`;

exports[`exits with 1 if path threshold group is not found in coverage data 1`] = `
Expand All @@ -82,7 +80,6 @@ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
All files | 100 | 100 | 100 | 100 | |
banana.js | 100 | 100 | 100 | 100 | |
-----------|----------|----------|----------|----------|-------------------|

`;

exports[`file is matched by all path and glob threshold groups 1`] = `
Expand All @@ -109,5 +106,4 @@ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
All files | 50 | 100 | 0 | 50 | |
banana.js | 50 | 100 | 0 | 50 | 3 |
-----------|----------|----------|----------|----------|-------------------|

`;
1 change: 0 additions & 1 deletion e2e/__tests__/__snapshots__/customReporters.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ exports[`Custom Reporters Integration invalid format for adding reporters 1`] =
Configuration Documentation:
https://jestjs.io/docs/configuration.html


`;

exports[`Custom Reporters Integration valid array format for adding reporters 1`] = `
Expand Down
2 changes: 0 additions & 2 deletions e2e/__tests__/__snapshots__/jestChangedFiles.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ exports[`handles a bad revision for "changedSince", for git 1`] = `

fatal: bad revision '^blablabla'


`;

exports[`handles a bad revision for "changedSince", for hg 1`] = `
Expand All @@ -17,5 +16,4 @@ exports[`handles a bad revision for "changedSince", for hg 1`] = `

abort: unknown revision 'blablabla'!


`;
1 change: 0 additions & 1 deletion e2e/__tests__/__snapshots__/processExit.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ exports[`prints stack trace pointing to process.exit call 1`] = `
11 | expect(true).toBe(true);

at Object.exit (__tests__/test.js:8:9)

`;
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ exports[`show error message when no js moduleFileExtensions 1`] = `
Configuration Documentation:
https://jestjs.io/docs/configuration.html


`;

exports[`show error message with matching files 1`] = `
Expand Down
3 changes: 1 addition & 2 deletions e2e/__tests__/__snapshots__/transform.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FAIL __tests__/ignoredFile.test.js
babel-jest: Babel ignores __tests__/ignoredFile.test.js - make sure to include the file in Jest's transformIgnorePatterns as well.
at loadBabelConfig (../../../packages/babel-jest/build/index.js:157:13)
at loadBabelConfig (../../../packages/babel-jest/build/index.js:174:13)
`;

exports[`babel-jest instruments only specific files and collects coverage 1`] = `
Expand All @@ -33,7 +33,6 @@ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
All files | 83.33 | 100 | 50 | 80 | |
covered.js | 83.33 | 100 | 50 | 80 | 13 |
------------|----------|----------|----------|----------|-------------------|
`;

exports[`transformer-config instruments only specific files and collects coverage 1`] = `
Expand Down
4 changes: 2 additions & 2 deletions e2e/__tests__/processExit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import {wrap} from 'jest-snapshot-serializer-raw';
import runJest from '../runJest';

it('prints stack trace pointing to process.exit call', async () => {
const {stderr} = await runJest('process-exit');
it('prints stack trace pointing to process.exit call', () => {
const {stderr} = runJest('process-exit');

expect(wrap(stderr)).toMatchSnapshot();
});
13 changes: 6 additions & 7 deletions e2e/__tests__/supportsDashedArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@ test('throws error for unknown dashed & camelcase args', () => {
'--useStderr',
]);
expect(result.stderr).toMatchInlineSnapshot(`
● Unrecognized CLI Parameters:
● Unrecognized CLI Parameters:

Following options were not recognized:
["doesNotExist", "also-does-not-exist"]
Following options were not recognized:
["doesNotExist", "also-does-not-exist"]

CLI Options Documentation:
https://jestjs.io/docs/en/cli.html
CLI Options Documentation:
https://jestjs.io/docs/en/cli.html


`);
`);
expect(result.status).toBe(1);
});
2 changes: 1 addition & 1 deletion e2e/__tests__/testRetries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Test Retries', () => {
it('retries failed tests', () => {
const result = runJest('test-retries', ['e2e.test.js']);

expect(result.code).toEqual(0);
expect(result.status).toEqual(0);
expect(result.failed).toBe(false);
});

Expand Down
17 changes: 10 additions & 7 deletions e2e/runJest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
import * as path from 'path';
import * as fs from 'fs';
import {Writable} from 'stream';
import execa, {ExecaChildProcess, ExecaReturns} from 'execa';
import execa, {
ExecaChildProcess,
ExecaReturnValue,
ExecaSyncReturnValue,
} from 'execa';
import stripAnsi from 'strip-ansi';
import {normalizeIcons} from './Utils';

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

if (isRelative) {
Expand Down Expand Up @@ -91,19 +95,18 @@ function spawnJest(
);
}

type RunJestResult = ExecaReturns & {
interface RunJestResult extends ExecaReturnValue {
status?: number;
code?: number;
json?: (
dir: string,
args: Array<string> | undefined,
options: RunJestOptions,
) => RunJestResult;
};
}

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
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "3.15.0",
"lerna": "3.16.4",
"version": "24.9.0",
"npmClient": "yarn",
"packages": [
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@typescript-eslint/eslint-plugin": "^2.0.0",
"@typescript-eslint/parser": "^2.0.0",
"ansi-regex": "^4.0.0",
"ansi-styles": "^3.2.0",
"ansi-styles": "^4.0.0",
"babel-eslint": "^10.0.2",
"babel-loader": "^8.0.5",
"babel-plugin-replace-ts-export-assignment": "^0.0.2",
Expand All @@ -29,32 +29,32 @@
"eslint": "~6.1.0",
"eslint-config-prettier": "^6.1.0",
"eslint-plugin-babel": "^5.1.0",
"eslint-plugin-flowtype": "^2.35.0",
"eslint-plugin-flowtype": "^4.2.0",
thymikee marked this conversation as resolved.
Show resolved Hide resolved
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jest": "^22.0.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.1.0",
"execa": "^1.0.0",
"execa": "^2.0.4",
"fast-check": "^1.13.0",
"glob": "^7.1.1",
"graceful-fs": "^4.1.15",
"isbinaryfile": "^4.0.0",
"istanbul-lib-coverage": "^2.0.2",
"istanbul-lib-report": "^2.0.4",
"istanbul-reports": "^2.1.1",
"jest-junit": "^6.2.1",
"jest-junit": "^7.0.0",
"jest-silent-reporter": "^0.1.2",
"jest-snapshot-serializer-raw": "^1.1.0",
"jest-watch-typeahead": "^0.3.1",
"jest-watch-typeahead": "^0.4.0",
"jquery": "^3.2.1",
"karma": "^4.0.1",
"karma-chrome-launcher": "^3.0.0",
"karma-mocha": "^1.3.0",
"karma-webpack": "4.0.0-rc.5",
"left-pad": "^1.1.1",
"lerna": "3.15.0",
"lerna": "3.16.4",
"micromatch": "^4.0.2",
"mkdirp": "^0.5.1",
"mocha": "^6.0.2",
Expand All @@ -66,9 +66,9 @@
"promise": "^8.0.2",
"realpath-native": "^1.1.0",
"resolve": "^1.4.0",
"rimraf": "^2.6.2",
"slash": "^2.0.0",
"string-length": "^2.0.0",
"rimraf": "^3.0.0",
"slash": "^3.0.0",
"string-length": "^3.1.0",
"strip-ansi": "^5.0.0",
"typescript": "^3.5.2",
"webpack": "^4.28.4"
Expand Down
5 changes: 2 additions & 3 deletions packages/babel-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
"babel-plugin-istanbul": "^5.1.0",
"babel-preset-jest": "^24.9.0",
"chalk": "^2.4.2",
"slash": "^2.0.0"
"slash": "^3.0.0"
},
"devDependencies": {
"@babel/core": "^7.1.0",
"@types/slash": "^2.0.0"
"@babel/core": "^7.1.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/expect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"browser": "build-es5/index.js",
"dependencies": {
"@jest/types": "^24.9.0",
"ansi-styles": "^3.2.0",
"ansi-styles": "^4.0.0",
"jest-get-type": "^24.9.0",
"jest-matcher-utils": "^24.9.0",
"jest-message-util": "^24.9.0",
Expand Down
7 changes: 2 additions & 5 deletions packages/jest-changed-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
"types": "build/index.d.ts",
"dependencies": {
"@jest/types": "^24.9.0",
"execa": "^1.0.0",
"throat": "^4.0.0"
},
"devDependencies": {
"@types/execa": "^0.9.0"
"execa": "^2.0.4",
"throat": "^5.0.0"
},
"engines": {
"node": ">= 8"
Expand Down
13 changes: 11 additions & 2 deletions packages/jest-changed-files/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import * as path from 'path';
import execa from 'execa';
import execa, {ExecaReturnValue} from 'execa';
import {Config} from '@jest/types';

import {SCMAdapter} from './types';
Expand All @@ -16,7 +16,16 @@ const findChangedFilesUsingCommand = async (
args: Array<string>,
cwd: Config.Path,
): Promise<Array<Config.Path>> => {
const result = await execa('git', args, {cwd});
let result: ExecaReturnValue;

try {
result = await execa('git', args, {cwd});
} catch (e) {
// TODO: Should we keep the original `message`?
e.message = e.stderr;

throw e;
}

return result.stdout
.split('\n')
Expand Down
13 changes: 11 additions & 2 deletions packages/jest-changed-files/src/hg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import * as path from 'path';
import execa from 'execa';
import execa, {ExecaReturnValue} from 'execa';
import {Config} from '@jest/types';

import {SCMAdapter} from './types';
Expand All @@ -29,7 +29,16 @@ const adapter: SCMAdapter = {
}
args.push(...includePaths);

const result = await execa('hg', args, {cwd, env});
let result: ExecaReturnValue;

try {
result = await execa('hg', args, {cwd, env});
} catch (e) {
// TODO: Should we keep the original `message`?
e.message = e.stderr;

throw e;
}

return result.stdout
.split('\n')
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-circus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
"jest-util": "^24.9.0",
"pretty-format": "^24.9.0",
"stack-utils": "^1.0.1",
"throat": "^4.0.0"
"throat": "^5.0.0"
},
"devDependencies": {
"@jest/test-utils": "^24.4.0",
"@types/babel__traverse": "^7.0.4",
"@types/co": "^4.6.0",
"@types/stack-utils": "^1.0.1",
"execa": "^1.0.0",
"execa": "^2.0.4",
"jest-runtime": "^24.9.0"
},
"engines": {
Expand Down
Loading