Skip to content

Commit

Permalink
Update rejection normative message assertions (#48717)
Browse files Browse the repository at this point in the history
* chore: complete rejection messages are not normative

* chore: AbortError messages are not normative
  • Loading branch information
maraisr authored Oct 23, 2024
1 parent 9220b4d commit d4c28b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dom/observable/tentative/observable-first.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ promise_test(async () => {

assert_true(rejection instanceof RangeError,
"Upon complete(), first() Promise rejects with RangeError");
assert_equals(rejection.message, "No values in Observable");
assert_true(typeof rejection.message === "string", "Rejection message must be a string");
}, "first(): Promise rejects with RangeError when source Observable " +
"completes without emitting any values");

Expand All @@ -72,7 +72,7 @@ promise_test(async () => {
"Promise rejects with a DOMException for abortion");
assert_equals(rejection.name, "AbortError",
"Rejected with 'AbortError' DOMException");
assert_equals(rejection.message, "signal is aborted without reason");
assert_true(typeof rejection.message === "string", "Rejection message must be a string");
}, "first(): Aborting a signal rejects the Promise with an AbortError DOMException");

promise_test(async () => {
Expand Down
2 changes: 1 addition & 1 deletion dom/observable/tentative/observable-last.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ promise_test(async () => {

assert_true(rejection instanceof RangeError,
"Promise rejects with RangeError");
assert_equals(rejection.message, "No values in Observable");
assert_true(typeof rejection.message === "string", "Rejection message must be a string");
}, "last(): Promise rejects with RangeError when source Observable " +
"completes without emitting any values");

Expand Down

0 comments on commit d4c28b9

Please sign in to comment.