-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
DOM: add tests for AbortSignal.reason #31291
Conversation
Can you add descriptions to assertions? Descriptions don't have to be long (I feel "signal reason should be set when controller is aborted" is a bit too long). Assertion description is useful to find the failed assertion in a test, so it can be anything as long as it is unique in the test. So the first test case can be:
|
Makes sense! I've added assertion descriptions to my tests based on your suggestion. |
@annevk Is it okay if you also take a look to see if the tests in this PR look okay to you? |
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 recommend running the tests even if they will fail to spot syntax errors and such.
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.
For the new tests it seems good to assert some fields before calling abort()
as well. At least once. E.g., assert_true("reason" in signal)
and assert_equals(signal.reason, undefined)
.
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.
Add tests for
AbortSignal
's new abort reason property.See whatwg/dom#1027 for accompanying spec change.