-
Notifications
You must be signed in to change notification settings - Fork 632
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
BREAKING(asserts): move std/testing/asserts
to std/assert
#3445
Conversation
std/testing/asserts
to std/asserts
std/testing/asserts
to std/asserts
I think this structure make more sense because there're cases when the users call assertions from non test code (for runtime assertion). Single-export file structure also makes sense to me. If the user wants to use them in runtime code, they should want more granular import instead of importing the entire What do you think? @ry @bartlomieju @piscisaureus @lucacasonato |
testing/asserts.ts
Outdated
@@ -1,6 +1,9 @@ | |||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. | |||
|
|||
/** A library of assertion functions. | |||
/** | |||
* @deprecated (will be removed after 0.200.0) Import from `std/asserts` instead. |
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.
Maybe let's wait for a little more than usual deprecation period? testing/asserts
are heavily depended by the ecosystem.
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.
The usual deprecation period is 3 minor versions. This is 9 minor versions, like the recent std/semver
migration (#3385). Happy to increase this if you still think it should be pushed out.
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.
I'm ok with the move, but I think we should maintain backwards compatibility.
Assuming the usual release cadence of a minor release every two weeks, the deprecation would be in place for over 4 months before removal. Backwards compatibility would remain until then. |
I would suggest we give it at least 3 months time before removing |
I've moved the assertion test and extended the removal version to 0.204.0. That's ~3 months from now, assuming a weekly release cadence. |
Do we want to replace the use of |
std/testing/asserts
to std/asserts
std/testing/asserts
to std/assert
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
@fbaltor it's very strange that you get these warnings - in |
You are absolutely right. I made some confusion by inadvertently updating the submodules. Thank you, @bartlomieju! |
This change moves the functions in std/testing/asserts.ts to their separate files in a new top-level
std/asserts
folder. Use of_utils/asserts.ts
has also been replaced byasserts/asserts.ts
. The reasoning behind this is:assert()
for this reason - to keep dependencies lean.Related previous migrations:
encoding/csv
to own top-level folder and towards single-export files #3228