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

chore: move typecheck test files from root into packages #12099

Merged
merged 5 commits into from
Nov 30, 2021
Merged

chore: move typecheck test files from root into packages #12099

merged 5 commits into from
Nov 30, 2021

Conversation

mrazauskas
Copy link
Contributor

Summary

Split from #12059

Moving these files from root into packages simplifies setup of typechecks and allows to test type of packages in isolation. At this moment the need is not clear. As it was explained in #12059, in the future this setup will help to check that types added by Jest (snapshotState, addSnapshotSerializer and SnapshotMatchers) do not leak to expect package.

Test plan

Just move and renamed the files. All should work as before.

export type E = expect.Matchers<>;
// @ts-expect-error: Generic type 'Matchers<R, T>' requires between 1 and 2 type arguments.
export type E = expect.Matchers;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was my mistake. // @ts-expect-error was silencing syntax error instead of expected type error. Wrapping the code into expect() would help to avoid mistakes like this one. Just another motivation for Jestish typecheck runner. Working on it.

@codecov-commenter
Copy link

Codecov Report

Merging #12099 (22ea546) into main (40a9027) will decrease coverage by 1.25%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12099      +/-   ##
==========================================
- Coverage   68.91%   67.65%   -1.26%     
==========================================
  Files         324      328       +4     
  Lines       16681    16989     +308     
  Branches     4814     4817       +3     
==========================================
- Hits        11495    11494       -1     
- Misses       5153     5462     +309     
  Partials       33       33              
Impacted Files Coverage Δ
packages/jest-types/__typechecks__/config.test.ts 0.00% <ø> (ø)
packages/jest-types/__typechecks__/expect.test.ts 0.00% <ø> (ø)
packages/jest-types/__typechecks__/globals.test.ts 0.00% <ø> (ø)
packages/jest-types/__typechecks__/jest.test.ts 0.00% <ø> (ø)
packages/expect/src/utils.ts 96.03% <0.00%> (-0.50%) ⬇️

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 40a9027...22ea546. Read the comment docs.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

thanks!

@SimenB SimenB merged commit 30a69fb into jestjs:main Nov 30, 2021
@mrazauskas mrazauskas deleted the chore-move-typechecks branch November 30, 2021 08:15
@github-actions
Copy link

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 Dec 31, 2021
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