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

fix: implement CallbackTestRunnerInterface instead of extending CallbackTestRunner class #134

Merged
merged 1 commit into from
Aug 9, 2022
Merged

Conversation

mrazauskas
Copy link
Contributor

@mrazauskas mrazauskas commented Aug 9, 2022

Following up #113

As reported in jest-community/jest-runner-tsd#97 jest-runner has to be moved to dependencies instead of peer dependencies. This problem was introduced in #113, because CallbackTestRunner class got imported from 'jest-runner' instead of types only import.

Switching to CallbackTestRunnerInterface instead of extending the class should fix the issue.

Closes jest-community/jest-runner-tsd#97

return class BaseTestRunner extends CallbackTestRunner {
) {
return class BaseTestRunner implements CallbackTestRunnerInterface {
#globalConfig: Config.GlobalConfig;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TS is fine with #, but does not allow to have private _globalConfig: "Property '_globalConfig' of exported class expression may not be private or protected."

Hm.. Should Node 12 support be dropped before merging this change?

matrix:
node-version: [12.x, 14.x, 16.x, 17.x]

Copy link
Member

Choose a reason for hiding this comment

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

do we need to use # now, or is that just a refactoring?

Copy link
Contributor Author

@mrazauskas mrazauskas Aug 9, 2022

Choose a reason for hiding this comment

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

Can be public as well. Is that fine?

private was not allowed by TS, so I went for #. But before #113 this field was marked public. Can stay like that too.

Copy link
Member

Choose a reason for hiding this comment

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

Private is fine 🙂 this class isn't used by consumers anyways

Copy link
Member

Choose a reason for hiding this comment

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

@mrazauskas landed #135 fwiw

@SimenB SimenB merged commit 2ca9516 into jest-community:main Aug 9, 2022
@mrazauskas mrazauskas deleted the fix-deps-issue branch August 9, 2022 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants