Skip to content

Commit

Permalink
4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 11, 2021
1 parent e53ca1f commit 81259f3
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 31 deletions.
4 changes: 0 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,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 @@ -26,7 +26,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 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 @@ -36,7 +36,7 @@ export default async function readConfigFileAndSetRootDir(
} else {
configObject = await requireOrImportModule<any>(configPath);
}
} catch (error: unknown) {
} catch (error) {
if (isJSON) {
throw new Error(
`Jest: Failed to parse 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 ({
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);
}

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 @@ -595,7 +595,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 @@ -122,7 +122,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 @@ -510,7 +510,7 @@ const _toThrowErrorMatchingSnapshot = (
} else {
try {
received();
} catch (e: unknown) {
} catch (e) {
error = e;
}
}
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21198,22 +21198,22 @@ [email protected]:
linkType: hard

"typescript@*, typescript@^4.0.2, typescript@^4.0.3":
version: 4.3.5
resolution: "typescript@npm:4.3.5"
version: 4.4.3
resolution: "typescript@npm:4.4.3"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: d9a8e78d72dd19896e6bfa73ab2a0fcea6eca2700d1d6e7c33f67a970af54a3e0fed8f715a8c4e6a0ff7fc0995067b394b2003518ab0aa84cd396377e54b760c
checksum: 0da3a2a96506240557512ee49ff37a882c49c8c803444b90b98984e50d5d2e526885d57cd0f75225525413630b0e070e0e9ab4538485852fa1c158a6e7925cbb
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=8133ad"
version: 4.4.3
resolution: "typescript@patch:typescript@npm%3A4.4.3#builtin<compat/typescript>::version=4.4.3&hash=8133ad"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 7e9040a3ee8b62c9f499fdaeeb2ea143c079e88fadeba562ce2f7ee878cf3eba9cf6097bf8a4ead0de4b35582f71a4866d9f475af9b064fde430d55d9fc6aaac
checksum: d328b850f6e56d424dfda4b2bf2950fcc2f8bb21446f0eb9fe2d4b7a4f9b678a4f17204a31f6ad2dfb2419a69e508683d938491cecc2650aedde9423e5489825
languageName: node
linkType: hard

Expand Down

0 comments on commit 81259f3

Please sign in to comment.