-
Notifications
You must be signed in to change notification settings - Fork 640
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
refactor: use _util/asserts.ts
for non-test code
#2857
Conversation
_util/asserts.ts
is used for non-test code_util/asserts.ts
for non-test code
I think what we actually need in |
Thanks for the good suggestions! I've made the changes, except for moving I've redone my initial comment on this PR to reflect the new changes. |
All internal non-test code, that is files that do not have `test` or `bench` in | ||
the name, must use the assertion functions within `_utils/asserts.ts` and not | ||
`testing/asserts.ts`. This is to create a separation of concerns between | ||
internal and testing assertions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR:
_util/assert.ts
to_util/asserts.ts
.unreachable
assertion to_util/asserts.ts
, along with corresponding test in_util/asserts_test.ts
.testing/asserts.ts
to use_util/asserts.ts
._util/assert.ts
and the "Contributing" section of the repo readme.This is half of what was discussed in #2849. I'll create a tool to enforce the rule after this PR lands.