Getting expecting rejection to match gets <unknown> instead of actual expectation.
Categories
(WebExtensions :: General, defect, P5)
Tracking
(firefox-esr78 wontfix, firefox81 wontfix, firefox82 fixed)
People
(Reporter: masterwayz, Assigned: masterwayz, Mentored)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(1 file)
This seems to be caused by this commit: https://hg.mozilla.org/mozilla-central/rev/9ae69a2f818d
When removing .toSource()
on here: https://searchfox.org/mozilla-central/source/toolkit/components/extensions/child/ext-test.js#89 then it works normally again.
It makes debugging harder as instead of reporting what is expected to match, for example:
Promise rejected, expecting rejection to match 'matching string here'
, we get:
Promise rejected, expecting rejection to match <unknown>
.
Comment 1•4 years ago
|
||
A way to trigger this bug is as follows:
browser.test.assertRejects(
Promise.reject("dummy"),
/not-dummy/,
"intentional failure"
);
.toSource
is not available any more because of bug 1565170.
That code path can be reached through https://searchfox.org/mozilla-central/rev/0c97a6410ff018c22e65a0cbe4e5f2ca4581b22e/toolkit/components/extensions/child/ext-test.js#209-211,231-233
depending on the value of expectedError
.
Potential values for expectedError
are specified by the JSON schema at https://searchfox.org/mozilla-central/rev/0c97a6410ff018c22e65a0cbe4e5f2ca4581b22e/toolkit/components/extensions/schemas/test.json#145-149,165-169,180-185
toSource
was removed in bug 1565170, and its purpose was to create a human-readable serialization of a value. In these cases, String(value)
should probably have the desired result.
Do you want to submit a patch?
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Sure, I'll take it.
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Comment 5•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Description
•