Skip to content

Commit

Permalink
chore: bump deps (#10496)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 9, 2020
1 parent ec75280 commit aa02c2d
Show file tree
Hide file tree
Showing 29 changed files with 515 additions and 395 deletions.
17 changes: 16 additions & 1 deletion .eslintrc.js
Expand Up @@ -16,6 +16,7 @@ module.exports = {
],
overrides: [
{
extends: ['plugin:@typescript-eslint/eslint-recommended'],
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin'],
Expand All @@ -31,11 +32,14 @@ module.exports = {
{argsIgnorePattern: '^_'},
],
'@typescript-eslint/prefer-ts-expect-error': 'error',
// Since we do `export =`. Remove for Jest 25
// Since we do `export =`. Remove for Jest 27
'import/default': 'off',
'import/order': 'error',
'no-dupe-class-members': 'off',
'no-unused-vars': 'off',
// TODO: turn these on at some point
'prefer-rest-params': 'off',
'prefer-spread': 'off',
},
},
// to make it more suitable for running on code examples in docs/ folder
Expand Down Expand Up @@ -107,6 +111,17 @@ module.exports = {
'eslint-comments/no-unlimited-disable': 0,
},
},
{
files: [
'e2e/error-on-deprecated/__tests__/*',
'e2e/jasmine-async/__tests__/*',
],
globals: {
fail: true,
jasmine: true,
pending: true,
},
},
{
files: [
'website/**',
Expand Down
2 changes: 1 addition & 1 deletion .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions .yarn/releases/yarn-sources.cjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions e2e/__tests__/__snapshots__/moduleNameMapper.test.ts.snap
Expand Up @@ -41,7 +41,7 @@ FAIL __tests__/index.js
12 | module.exports = () => 'test';
13 |
at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:552:17)
at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:551:17)
at Object.require (index.js:10:1)
`;

Expand Down Expand Up @@ -70,6 +70,6 @@ FAIL __tests__/index.js
12 | module.exports = () => 'test';
13 |
at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:552:17)
at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:551:17)
at Object.require (index.js:10:1)
`;
Expand Up @@ -37,6 +37,6 @@ FAIL __tests__/test.js
| ^
9 |
at Resolver.resolveModule (../../packages/jest-resolve/build/index.js:307:11)
at Resolver.resolveModule (../../packages/jest-resolve/build/index.js:306:11)
at Object.require (index.js:8:18)
`;
Expand Up @@ -8,13 +8,13 @@ FAIL __tests__/fails.ts
This did not work!
11 |
12 | export function error() {
> 13 | throw new Error('This did not work!');
13 |
14 | export function error() {
> 15 | throw new Error('This did not work!');
| ^
14 | }
15 |
16 | }
17 |
at Object.error (lib.ts:13:9)
at Object.error (lib.ts:15:9)
at Object.<anonymous> (__tests__/fails.ts:10:3)
`;
6 changes: 3 additions & 3 deletions e2e/__tests__/stackTraceSourceMaps.test.ts
Expand Up @@ -13,7 +13,7 @@ it('processes stack traces and code frames with source maps', () => {
const dir = path.resolve(__dirname, '../stack-trace-source-maps');
runYarn(dir);
const {stderr} = runJest(dir, ['--no-cache']);
expect(stderr).toMatch('> 14 | (() => expect(false).toBe(true))();');
expect(stderr).toMatch(`at __tests__/fails.ts:14:24
at Object.<anonymous> (__tests__/fails.ts:14:35)`);
expect(stderr).toMatch('> 15 | (() => expect(false).toBe(true))();');
expect(stderr).toMatch(`at __tests__/fails.ts:15:24
at Object.<anonymous> (__tests__/fails.ts:15:35)`);
});
2 changes: 2 additions & 0 deletions e2e/stack-trace-source-maps-with-coverage/lib.ts
Expand Up @@ -4,6 +4,8 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @ts-expect-error
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface NotUsedButTakesUpLines {
a: number;
b: string;
Expand Down
1 change: 1 addition & 0 deletions e2e/stack-trace-source-maps/__tests__/fails.ts
Expand Up @@ -4,6 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface NotUsedButTakesUpLines {
a: number;
b: string;
Expand Down
18 changes: 8 additions & 10 deletions package.json
Expand Up @@ -19,8 +19,8 @@
"@types/jest": "24.0.2",
"@types/node": "~10.14.0",
"@types/which": "^1.3.2",
"@typescript-eslint/eslint-plugin": "^3.9.1",
"@typescript-eslint/parser": "^3.9.1",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"ansi-regex": "^5.0.0",
"ansi-styles": "^4.2.0",
"babel-eslint": "^10.0.3",
Expand All @@ -38,7 +38,7 @@
"eslint-plugin-eslint-comments": "^3.1.2",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jest": "^23.0.2",
"eslint-plugin-jest": "^24.0.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-prettier": "^3.0.1",
Expand Down Expand Up @@ -103,13 +103,11 @@
"watch": "yarn build && node ./scripts/watch.js",
"watch:ts": "yarn build:ts --watch"
},
"workspaces": {
"packages": [
"packages/*",
"website",
"examples/*"
]
},
"workspaces": [
"packages/*",
"website",
"examples/*"
],
"prettier": {
"bracketSpacing": false,
"proseWrap": "never",
Expand Down
13 changes: 8 additions & 5 deletions packages/babel-plugin-jest-hoist/src/index.ts
Expand Up @@ -291,11 +291,14 @@ export default (): PluginObj<{
callee.name === this.jestObjGetterIdentifier?.name
) {
const mockStmt = callExpr.getStatementParent();
const mockStmtNode = mockStmt.node;
const mockStmtParent = mockStmt.parentPath;
if (mockStmtParent.isBlock()) {
mockStmt.remove();
mockStmtParent.unshiftContainer('body', [mockStmtNode]);

if (mockStmt) {
const mockStmtNode = mockStmt.node;
const mockStmtParent = mockStmt.parentPath;
if (mockStmtParent.isBlock()) {
mockStmt.remove();
mockStmtParent.unshiftContainer('body', [mockStmtNode]);
}
}
}
},
Expand Down
1 change: 0 additions & 1 deletion packages/expect/src/index.ts
Expand Up @@ -419,7 +419,6 @@ expect.extractExpectedAssertionsErrors = extractExpectedAssertionsErrors;

const expectExport = expect as Expect;

// eslint-disable-next-line no-redeclare
namespace expectExport {
export type MatcherState = JestMatcherState;
export interface Matchers<R> extends MatcherInterface<R> {}
Expand Down
5 changes: 3 additions & 2 deletions packages/jest-circus/src/types.ts
Expand Up @@ -6,9 +6,7 @@
*/

// Used as type
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import expect = require('expect');
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type {Circus} from '@jest/types';

export const STATE_SYM = (Symbol(
Expand All @@ -22,8 +20,11 @@ export const TEST_TIMEOUT_SYMBOL = (Symbol.for(
'TEST_TIMEOUT_SYMBOL',
) as unknown) as 'TEST_TIMEOUT_SYMBOL';

// https://github.com/typescript-eslint/typescript-eslint/issues/2523
// eslint-disable-next-line @typescript-eslint/no-unused-vars
declare global {
module NodeJS {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Global {
STATE_SYM_SYMBOL: Circus.State;
RETRY_TIMES_SYMBOL: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-cli/package.json
Expand Up @@ -17,7 +17,7 @@
"jest-util": "^26.3.0",
"jest-validate": "^26.4.2",
"prompts": "^2.0.1",
"yargs": "^15.3.1"
"yargs": "^16.0.1"
},
"devDependencies": {
"@jest/test-utils": "^26.3.0",
Expand Down
1 change: 0 additions & 1 deletion packages/jest-haste-map/src/index.ts
Expand Up @@ -214,7 +214,6 @@ function invariant(condition: unknown, message?: string): asserts condition {
* Worker processes can directly access the cache through `HasteMap.read()`.
*
*/
/* eslint-disable-next-line no-redeclare */
class HasteMap extends EventEmitter {
private _buildPromise: Promise<InternalHasteMapObject> | null;
private _cachePath: Config.Path;
Expand Down
1 change: 0 additions & 1 deletion packages/jest-jasmine2/src/index.ts
Expand Up @@ -226,7 +226,6 @@ const addSnapshotData = (
return results;
};

// eslint-disable-next-line no-redeclare
namespace jasmine2 {
export type Jasmine = JestJasmine;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/jest-jasmine2/src/types.ts
Expand Up @@ -95,8 +95,11 @@ export type Jasmine = {
} & typeof expect &
NodeJS.Global;

// https://github.com/typescript-eslint/typescript-eslint/issues/2523
// eslint-disable-next-line @typescript-eslint/no-unused-vars
declare global {
module NodeJS {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Global {
expect: typeof expect;
}
Expand Down
1 change: 0 additions & 1 deletion packages/jest-mock/src/index.ts
Expand Up @@ -1093,6 +1093,5 @@ class ModuleMockerClass {
}
}

/* eslint-disable-next-line no-redeclare */
const JestMock = new ModuleMockerClass(global);
export = JestMock;
2 changes: 1 addition & 1 deletion packages/jest-repl/package.json
Expand Up @@ -16,7 +16,7 @@
"jest-runtime": "^26.4.2",
"jest-validate": "^26.4.2",
"repl": "^0.1.3",
"yargs": "^15.3.1"
"yargs": "^16.0.1"
},
"devDependencies": {
"@jest/test-utils": "^26.3.0",
Expand Down
1 change: 0 additions & 1 deletion packages/jest-resolve-dependencies/src/index.ts
Expand Up @@ -21,7 +21,6 @@ namespace DependencyResolver {
* DependencyResolver is used to resolve the direct dependencies of a module or
* to retrieve a list of all transitive inverse dependencies.
*/
/* eslint-disable-next-line no-redeclare */
class DependencyResolver {
private _hasteFS: HasteFS;
private _resolver: ResolverType;
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-resolve/src/defaultResolver.ts
Expand Up @@ -23,6 +23,8 @@ type ResolverOptions = {
packageFilter?: ResolveOpts['packageFilter'];
};

// https://github.com/typescript-eslint/typescript-eslint/issues/2523
// eslint-disable-next-line @typescript-eslint/no-unused-vars
declare global {
namespace NodeJS {
export interface ProcessVersions {
Expand Down
1 change: 0 additions & 1 deletion packages/jest-resolve/src/index.ts
Expand Up @@ -52,7 +52,6 @@ const nodePaths = NODE_PATH
.map(p => path.resolve(resolvedCwd, p))
: undefined;

/* eslint-disable-next-line no-redeclare */
class Resolver {
private readonly _options: ResolverConfig;
private readonly _moduleMap: ModuleMap;
Expand Down
1 change: 0 additions & 1 deletion packages/jest-runner/src/index.ts
Expand Up @@ -45,7 +45,6 @@ namespace TestRunner {
export type TestFileEvent = JestTestFileEvent;
}

/* eslint-disable-next-line no-redeclare */
class TestRunner {
private readonly _globalConfig: Config.GlobalConfig;
private readonly _context: JestTestRunnerContext;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-runtime/package.json
Expand Up @@ -35,7 +35,7 @@
"jest-validate": "^26.4.2",
"slash": "^3.0.0",
"strip-bom": "^4.0.0",
"yargs": "^15.3.1"
"yargs": "^16.0.1"
},
"devDependencies": {
"@jest/test-utils": "^26.3.0",
Expand Down
1 change: 0 additions & 1 deletion packages/jest-runtime/src/index.ts
Expand Up @@ -140,7 +140,6 @@ type RunScriptEvalResult = {[EVAL_RESULT_VARIABLE]: ModuleWrapper};

const runtimeSupportsVmModules = typeof SyntheticModule === 'function';

/* eslint-disable-next-line no-redeclare */
class Runtime {
private _cacheFS: StringMap;
private _config: Config.ProjectConfig;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-snapshot/src/index.ts
Expand Up @@ -557,7 +557,7 @@ const JestSnapshot = {
toThrowErrorMatchingSnapshot,
utils,
};
/* eslint-disable-next-line no-redeclare */

namespace JestSnapshot {
export type SnapshotResolver = JestSnapshotResolver;
export type SnapshotStateType = SnapshotState;
Expand Down
6 changes: 4 additions & 2 deletions packages/pretty-format/src/__tests__/setPrettyPrint.ts
Expand Up @@ -6,11 +6,13 @@
*/

import prettyFormat from '../';
import {OptionsReceived, Plugins} from '../types';
import type {OptionsReceived, Plugins} from '../types';

// https://github.com/typescript-eslint/typescript-eslint/issues/2523
// eslint-disable-next-line @typescript-eslint/no-unused-vars
declare global {
// eslint-disable-next-line no-redeclare
namespace jest {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Matchers<R> {
toPrettyPrintTo(expected: any, options?: OptionsReceived): R;
}
Expand Down
1 change: 0 additions & 1 deletion packages/pretty-format/src/index.ts
Expand Up @@ -527,7 +527,6 @@ prettyFormat.plugins = {
ReactTestComponent,
};

// eslint-disable-next-line no-redeclare
namespace prettyFormat {
export type Colors = PrettyFormat.Colors;
export type Config = PrettyFormat.Config;
Expand Down

0 comments on commit aa02c2d

Please sign in to comment.