Closed Bug 1698296 Opened 3 years ago Closed 3 years ago

Make the 2nd parameter of test.assertRejects/assertThrows non-optional

Categories

(WebExtensions :: General, task, P2)

task

Tracking

(firefox88 fixed)

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: evilpie, Assigned: evilpie)

References

Details

Attachments

(3 files, 1 obsolete file)

Currently calls like browser.test.assertRejects(promise, "foo") are treated like test.assertRejects(promise, undefined, "foo"). This causes some tests to not actually check for the expected error.

Assignee: nobody → evilpies
Status: NEW → ASSIGNED

Depends on D108328

Severity: -- → N/A
Priority: -- → P2
Attachment #9208915 - Attachment description: Bug 1698296 - Make 2nd parameter of test.assertRejects non-optional. r?robwu → Bug 1698296 - Make 2nd parameter of test.assertRejects non-optional and fix tests. r?robwu
Summary: Make 2nd parameter of test.assertRejects non-optional → Make the 2nd parameter of test.assertRejects/assertThrows non-optional
Attachment #9208916 - Attachment is obsolete: true
Attachment #9209827 - Attachment description: Bug 1698296 - Make 2nd parameter of test.assertThrows non-optional and fix tests. r?robwu → Bug 1698296 - Make 2nd parameter of test.assertThrows non-optional. r?robwu

Before this would produce something like '..got "abc",null" which is rather ugly.

Depends on D108829

Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/4599bfe652f1
Make 2nd parameter of test.assertRejects non-optional and fix tests. r=robwu
https://hg.mozilla.org/integration/autoland/rev/ba145dd5f92e
Make 2nd parameter of test.assertThrows non-optional. r=robwu
https://hg.mozilla.org/integration/autoland/rev/f7899d54569f
Improve error formatting with missing msg and test. r=robwu
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/3d3275698516
Port bug 1698296 - Make 2nd parameter of test.assertRejects non-optional and fix tests. rs=bustage-fix DONTBUILD
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: