Skip to content

Commit

Permalink
4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Feb 9, 2022
1 parent 1b50a4c commit bd5d99c
Show file tree
Hide file tree
Showing 21 changed files with 37 additions and 41 deletions.
4 changes: 0 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ module.exports = {
rules: {
'@typescript-eslint/array-type': ['error', {default: 'generic'}],
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/no-implicit-any-catch': [
'error',
{allowExplicitAny: true},
],
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_'},
Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/resolveConditions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ onNodeVersions('>=12.16.0', () => {
});
try {
expect(exitCode).toBe(0);
} catch (error: unknown) {
} catch (error) {
console.log(`Test failed on iteration ${i + 1}`);
throw error;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@jest/globals": "workspace:*",
"@jest/test-utils": "workspace:*",
"@tsconfig/node12": "^1.0.9",
"@tsd/typescript": "~4.3.5",
"@tsd/typescript": "~4.4.4",
"@types/babel__core": "^7.0.0",
"@types/babel__generator": "^7.0.0",
"@types/babel__template": "^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 @@ -26,7 +26,7 @@
},
"devDependencies": {
"@jest/test-utils": "^27.5.1",
"@tsd/typescript": "~4.3.5",
"@tsd/typescript": "~4.4.4",
"chalk": "^4.0.0",
"fast-check": "^2.0.0",
"immutable": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/expect/src/__tests__/isError.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('isError', () => {
testErrorFromDifferentContext((win: Window) => {
try {
win.document.querySelectorAll('');
} catch (e: unknown) {
} catch (e) {
return e;
}
return null;
Expand Down
2 changes: 1 addition & 1 deletion packages/expect/src/toThrowMatchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const createMatcher = (
} else {
try {
received();
} catch (e: unknown) {
} catch (e) {
thrown = getThrown(e);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-circus/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const _callCircusHook = async ({
timeout,
});
await dispatch({describeBlock, hook, name: 'hook_success', test});
} catch (error: unknown) {
} catch (error) {
await dispatch({describeBlock, error, hook, name: 'hook_failure', test});
}
};
Expand All @@ -180,7 +180,7 @@ const _callCircusTest = async (
timeout,
});
await dispatch({name: 'test_fn_success', test});
} catch (error: unknown) {
} catch (error) {
await dispatch({error, name: 'test_fn_failure', test});
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-circus/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export const callAsyncCircusFn = (
} else {
try {
returnedValue = fn.call(testContext);
} catch (error: unknown) {
} catch (error) {
reject(error);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-config/src/readConfigFileAndSetRootDir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default async function readConfigFileAndSetRootDir(
} else {
configObject = await requireOrImportModule<any>(configPath);
}
} catch (error: unknown) {
} catch (error) {
if (isTS) {
throw new Error(
`Jest: Failed to parse the TypeScript config file ${configPath}\n` +
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-core/src/TestScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class TestScheduler {
);
}
}
} catch (error: unknown) {
} catch (error) {
if (!watcher.isInterrupted()) {
throw error;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-core/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const _run10000 = async (
filterSetupPromise = (async () => {
try {
await rawFilter.setup();
} catch (err: unknown) {
} catch (err) {
return err;
}
return undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-core/src/runGlobalHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default async function runGlobalHook({
await globalModule(globalConfig);
},
);
} catch (error: unknown) {
} catch (error) {
if (util.types.isNativeError(error)) {
error.message = `Jest: Got error running ${moduleName} - ${modulePath}, reason: ${error.message}`;

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-fake-timers/src/legacyFakeTimers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export default class FakeTimers<TimerRef> {
let errThrown = false;
try {
cb();
} catch (e: unknown) {
} catch (e) {
errThrown = true;
cbErr = e;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-jasmine2/src/PCancelable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default class PCancelable<T> implements PromiseLike<T> {
if (typeof this._cancel === 'function') {
try {
this._cancel();
} catch (err: unknown) {
} catch (err) {
this._reject(err);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-jasmine2/src/jasmineAsyncInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function makeConcurrent(
`Jest: concurrent test "${spec.getFullName()}" must return a Promise.`,
);
});
} catch (error: unknown) {
} catch (error) {
promise = Promise.reject(error);
}
// Avoid triggering the uncaught promise rejection handler in case the test errors before
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-mock/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ export class ModuleMocker {

return undefined;
})();
} catch (error: unknown) {
} catch (error) {
// Store the thrown error so we can record it, then re-throw it.
thrownError = error;
callDidThrowError = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-resolve/src/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default class Resolver {
paths: paths ? (nodePaths || []).concat(paths) : nodePaths,
rootDir: options.rootDir,
});
} catch (e: unknown) {
} catch (e) {
if (options.throwIfNotFound) {
throw e;
}
Expand Down
10 changes: 5 additions & 5 deletions packages/jest-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ export default class Runtime {
this._esmoduleRegistry.set(cacheKey, module);

transformResolve();
} catch (error: unknown) {
} catch (error) {
transformReject(error);
throw error;
}
Expand Down Expand Up @@ -838,7 +838,7 @@ export default class Runtime {
options,
moduleRegistry,
);
} catch (error: unknown) {
} catch (error) {
moduleRegistry.delete(modulePath);
throw error;
}
Expand Down Expand Up @@ -1013,7 +1013,7 @@ export default class Runtime {
} else {
return this.requireModule<T>(from, moduleName);
}
} catch (e: unknown) {
} catch (e) {
const moduleNotFound = Resolver.tryCastModuleNotFoundError(e);
if (moduleNotFound) {
if (
Expand Down Expand Up @@ -1279,7 +1279,7 @@ export default class Runtime {
return this._resolveModule(from, moduleName, {
conditions: this.cjsConditions,
});
} catch (err: unknown) {
} catch (err) {
const module = this._resolver.getMockModule(from, moduleName);

if (module) {
Expand Down Expand Up @@ -1718,7 +1718,7 @@ export default class Runtime {
let modulePath;
try {
modulePath = this._resolveModule(from, moduleName, options);
} catch (e: unknown) {
} catch (e) {
const manualMock = this._resolver.getMockModule(from, moduleName);
if (manualMock) {
this._shouldMockModuleCache.set(moduleID, true);
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-snapshot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ const _toThrowErrorMatchingSnapshot = (
} else {
try {
received();
} catch (e: unknown) {
} catch (e) {
error = e;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"chalk": "^4.0.0"
},
"devDependencies": {
"@tsd/typescript": "~4.3.5",
"@tsd/typescript": "~4.4.4",
"tsd-lite": "^0.5.1"
},
"publishConfig": {
Expand Down
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2600,7 +2600,7 @@ __metadata:
"@jest/globals": "workspace:*"
"@jest/test-utils": "workspace:*"
"@tsconfig/node12": ^1.0.9
"@tsd/typescript": ~4.3.5
"@tsd/typescript": ~4.4.4
"@types/babel__core": ^7.0.0
"@types/babel__generator": ^7.0.0
"@types/babel__template": ^7.0.0
Expand Down Expand Up @@ -2803,7 +2803,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@jest/types@workspace:packages/jest-types"
dependencies:
"@tsd/typescript": ~4.3.5
"@tsd/typescript": ~4.4.4
"@types/istanbul-lib-coverage": ^2.0.0
"@types/istanbul-reports": ^3.0.0
"@types/node": "*"
Expand Down Expand Up @@ -4471,13 +4471,13 @@ __metadata:
languageName: node
linkType: hard

"@tsd/typescript@npm:~4.3.5":
version: 4.3.5
resolution: "@tsd/typescript@npm:4.3.5"
"@tsd/typescript@npm:~4.4.4":
version: 4.4.4
resolution: "@tsd/typescript@npm:4.4.4"
bin:
tsc: typescript/bin/tsc
tsserver: typescript/bin/tsserver
checksum: 28e7ead0687b767bf56aa3456aeabe8830c6d2175364ca6f278fdda074beca20a856483948db3a068490a7ffdac35fe92891029d37912b9e7afe55fc545ccc9d
checksum: 092a49faaad0ff8e3a84d2d695a29125a05a9cc0801260cec84ff2b62aa826db1437c20c9d96f9de4cff724e53e7fd31051bd4b70692e043350d33ae16b2372b
languageName: node
linkType: hard

Expand Down Expand Up @@ -9920,7 +9920,7 @@ __metadata:
dependencies:
"@jest/test-utils": ^27.5.1
"@jest/types": ^27.5.1
"@tsd/typescript": ~4.3.5
"@tsd/typescript": ~4.4.4
chalk: ^4.0.0
fast-check: ^2.0.0
immutable: ^4.0.0
Expand Down Expand Up @@ -20912,22 +20912,22 @@ react-native@0.64.0:
linkType: hard

"typescript@*, typescript@^4.0.2, typescript@^4.0.3":
version: 4.3.5
resolution: "typescript@npm:4.3.5"
version: 4.4.4
resolution: "typescript@npm:4.4.4"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: bab033b5e2b0790dd35b77fd005df976ef80b8d84fd2c6e63cc31808151875beae9216e5a315fe7068e8499905c3c354248fe83272cdfc13b7705635f0c66c97
checksum: 89ecb8436bb48ef5594d49289f5f89103071716b6e4844278f4fb3362856e31203e187a9c76d205c3f0b674d221a058fd28310dbcbcf5d95e9a57229bb5203f1
languageName: node
linkType: hard

"typescript@patch:typescript@*#~builtin<compat/typescript>, typescript@patch:typescript@^4.0.2#~builtin<compat/typescript>, typescript@patch:typescript@^4.0.3#~builtin<compat/typescript>":
version: 4.3.5
resolution: "typescript@patch:typescript@npm%3A4.3.5#~builtin<compat/typescript>::version=4.3.5&hash=493e53"
version: 4.4.4
resolution: "typescript@patch:typescript@npm%3A4.4.4#~builtin<compat/typescript>::version=4.4.4&hash=493e53"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 61fc1a2ca5037420de5bbe17c6ddc4cbcc0d52301ed94f0a7b5821c55ff9eb96307f0816f745ca8f0fc87ed92f3951cde6d97cd6fd6bc6920c02ea63b5b26259
checksum: bd629ad0da4a15d79aaad56baf3ee7d96f6a181760d430ae77f8c5325df7bffd9edee57544a3970e3651e8b796fe03a5838a7eb39c6d46cc3866c0b23d36a0dd
languageName: node
linkType: hard

Expand Down

0 comments on commit bd5d99c

Please sign in to comment.