Skip to content

chore: type invariant as assert function #9228

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

Merged
merged 1 commit into from
Nov 24, 2019
Merged

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Nov 24, 2019

Summary

typeSafety++

Test plan

Green CI

@codecov-io
Copy link

Codecov Report

Merging #9228 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9228      +/-   ##
==========================================
- Coverage   65.08%   65.06%   -0.02%     
==========================================
  Files         278      278              
  Lines       11865    11864       -1     
  Branches     2925     2924       -1     
==========================================
- Hits         7722     7719       -3     
- Misses       3516     3518       +2     
  Partials      627      627
Impacted Files Coverage Δ
packages/jest-circus/src/utils.ts 14.72% <ø> (-0.66%) ⬇️
packages/jest-haste-map/src/index.ts 81.26% <0%> (ø) ⬆️
packages/jest-circus/src/eventHandler.ts 7.05% <0%> (ø) ⬆️
packages/jest-circus/src/run.ts 0% <0%> (ø) ⬆️
packages/expect/src/utils.ts 94.93% <0%> (-1.27%) ⬇️

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 2c1addd...9b70728. Read the comment docs.

@@ -351,8 +351,11 @@ export const addErrorToEachTestUnderDescribe = (
}
};

export const invariant = (condition: unknown, message?: string) => {
export function invariant(
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

Yes please

@thymikee thymikee merged commit 346b074 into jestjs:master Nov 24, 2019
@SimenB SimenB deleted the assert-func branch November 24, 2019 14:19
@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 May 11, 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