Closed Bug 1093931 Opened 10 years ago Closed 10 years ago

Loop mocha tests with DOM Promises have failure modes that are hard to understand/debug

Categories

(Hello (Loop) :: Client, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla36
Iteration:
36.3

People

(Reporter: dmosedale, Assigned: dmosedale)

Details

Attachments

(1 file)

Rather than showing how the test failed, they just time out, and it's hard to figure out why.  Tbpl/Treeherder logs would be fairly useless in the case of failures here.

The fix is to upgrade Mocha to version 2.0.1.  The important change is that newer versions of Mocha support promises natively: you no longer use function(done) to declare the test as async.  Instead, you just have the test return the last promise on the chain.
Comment on attachment 8517058 [details] [diff] [review]
[landed fx-team] Update Loop mocha unit test framework to v2.0.1, which supports Promises

I've just fixed up the Promise uses that we introduced in multiplexGum_test.js.  It's not clear from a quick skim that the other existing promise uses in the tree would benefit as much from being tweaked to the new API, though it's certainly possible that they will.

This release of Mocha includes a wide variety of fixes and a few enhancements, everything, back to and include 1.18 in the History file:

https://github.com/mochajs/mocha/blob/2.0.1/History.md
Attachment #8517058 - Flags: review?(standard8)
Note that the reason there is no mocha.css diff included in the patch is because that file is literally unchanged since 1.17.1.
Attachment #8517058 - Flags: review?(standard8) → review+
Attachment #8517058 - Attachment description: Update Loop mocha unit test framework to v2.0.1, which supports Promises → [landed fx-team] Update Loop mocha unit test framework to v2.0.1, which supports Promises
https://hg.mozilla.org/mozilla-central/rev/1b52d3719b7f
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Iteration: --- → 36.3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: