Closed Bug 1473754 Opened 6 years ago Closed 6 years ago

Port bug 1452706 - Make the 'expected' argument to Assert.throws/rejects required rather than optional

Categories

(Thunderbird :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 63.0

People

(Reporter: jorgk-bmo, Assigned: jorgk-bmo)

Details

Attachments

(1 file)

After landing of bug 1452706 some tests fail:
TEST-UNEXPECTED-FAIL | comm/mailnews/mime/jsmime/test/test_custom_headers.js | xpcshell return code: 0
TEST-UNEXPECTED-FAIL | comm/mailnews/mime/jsmime/test/test_header_emitter.js | xpcshell return code: 0

https://taskcluster-artifacts.net/Im_fSMBGQPCDoldXjU-REQ/0/public/logs/live_backing.log
says:
Unexpected exception AssertionError: Error: The 'expected' argument was not supplied to Assert.throws()

And sure enough, we use assert.throws() in those two tests and nowhere else in C-C:
https://dxr.mozilla.org/comm-central/search?q=assert.throws&redirect=false
This does the trick.
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/a2edf68a0bf2
Port bug 1452706: Add 'expected' argument to Assert.throws. rs=bustage-fix DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 63.0
Comment on attachment 8990157 [details] [diff] [review]
1473754-assert-throws.patch

I was surprised that
assert.throws(function () { emitter.addDate(new Date("10000-01-01")); }, /Cannot encode an invalid date/);
throws "cannot encode" instead of "out of range". Maybe something already goes wrong in |new Date("10000-01-01")| like in |new Date(NaN)|. Anyway, this is "bustage fix", so if we care, we need to follow up in another bug.
Attachment #8990157 - Flags: review?(acelists)
Comment on attachment 8990157 [details] [diff] [review]
1473754-assert-throws.patch

Review of attachment 8990157 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!
Attachment #8990157 - Flags: review?(acelists) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: