Skip to content

fix(jest-jasmine2, jest-types): remove jasmine types from @jest/types - #12125

Merged
SimenB merged 8 commits into
jestjs:mainfrom
mrazauskas:fix-remove-jasmine-types
Feb 10, 2022
Merged

fix(jest-jasmine2, jest-types): remove jasmine types from @jest/types#12125
SimenB merged 8 commits into
jestjs:mainfrom
mrazauskas:fix-remove-jasmine-types

Conversation

@mrazauskas

Copy link
Copy Markdown
Contributor

Summary

Following up #12124

The change in the above mentioned PR would allow to move all jasmine specific types from @jest/types to its own package. If I got it right, since jest-circus is the default test runner these types do not belong in the Global interface.

Test plan

Code did not change.

// TODO: Get rid of this at some point
type Jasmine = {
_DEFAULT_TIMEOUT_INTERVAL?: number;
addMatchers: (matchers: Record<string, unknown>) => void;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addMatchers implementation was removed in #9853

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think addMatchers still exist on jasmine?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here I had in mind Jest globals. It was removed from Jest globals, but Jasmin types still have addMatchers here: https://github.com/facebook/jest/blob/0d0844a249a179197e82bd1ea097a4cb6dad9f32/packages/jest-jasmine2/src/types.ts#L91

@mrazauskas mrazauskas changed the title fix(jest-types, jest-jasmine2): remove jasmine types from @jest/types fix(jest-jasmine2, jest-types): remove jasmine types from @jest/types Dec 6, 2021
@codecov-commenter

codecov-commenter commented Dec 6, 2021

Copy link
Copy Markdown

Codecov Report

Merging #12125 (acefe11) into main (0c455a9) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #12125   +/-   ##
=======================================
  Coverage   68.46%   68.47%           
=======================================
  Files         324      324           
  Lines       16961    16959    -2     
  Branches     5055     5055           
=======================================
  Hits        11612    11612           
+ Misses       5317     5315    -2     
  Partials       32       32           
Impacted Files Coverage Δ
packages/jest-jasmine2/src/errorOnPrivate.ts 0.00% <0.00%> (ø)
packages/jest-jasmine2/src/jasmineAsyncInstall.ts 0.00% <0.00%> (ø)
packages/jest-jasmine2/src/jestExpect.ts 0.00% <0.00%> (ø)
packages/jest-jasmine2/src/setup_jest_globals.ts 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c455a9...acefe11. Read the comment docs.

@mrazauskas
mrazauskas marked this pull request as ready for review February 10, 2022 15:13
@mrazauskas

Copy link
Copy Markdown
Contributor Author

@SimenB This one is rebased as well.

@SimenB SimenB left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

Comment thread CHANGELOG.md Outdated
declare module '@jest/types' {
namespace Global {
interface GlobalAdditions {
jasmine: Jasmine;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about pending etc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copied them all here for completeness. They were not necessary internally, but might be useful for something else.

@SimenB SimenB added this to the Jest 28 milestone Feb 10, 2022

@SimenB SimenB left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

great stuff, thanks!

@SimenB
SimenB merged commit a5f58b5 into jestjs:main Feb 10, 2022
@mrazauskas
mrazauskas deleted the fix-remove-jasmine-types branch February 10, 2022 18:48
@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants