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

clean @ts-expect-error #12664

Merged
merged 2 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 0 additions & 2 deletions packages/jest-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2100,13 +2100,11 @@ export default class Runtime {
});

const setTimeout = (timeout: number) => {
// @ts-expect-error: https://github.com/Microsoft/TypeScript/issues/24587
this._environment.global[testTimeoutSymbol] = timeout;
return jestObject;
};

const retryTimes = (numTestRetries: number) => {
// @ts-expect-error: https://github.com/Microsoft/TypeScript/issues/24587
this._environment.global[retryTimesSymbol] = numTestRetries;
return jestObject;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-types/src/Global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,5 @@ export interface GlobalAdditions extends TestFrameworkGlobals {
export interface Global
extends GlobalAdditions,
Omit<typeof globalThis, keyof GlobalAdditions> {
[extras: string]: unknown;
[extras: string | symbol]: unknown;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm.. Perhaps instead of tweaking this one, it would be better to extend Global locally inside jest-runtime/src/types.ts. In somewhat similar way:

https://github.com/facebook/jest/blob/fe5f37038c3771aa9014bc351c0bddb04c35da7d/packages/jest-circus/src/types.ts#L10-L23

F3n67u marked this conversation as resolved.
Show resolved Hide resolved
}