[Settings] Fix unit tests with a newer mocha

RESOLVED FIXED

Status

Firefox OS
Gaia::Settings
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: julienw, Assigned: julienw)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

46 bytes, text/x-github-pull-request
arthurcc
: review+
Details | Review | Splinter Review
(Assignee)

Description

4 years ago
+++ This bug was initially created as a clone of Bug #1016429 +++

In Bug 874510, we try to upgrade mocha and there is yet another issue:

 1) [settings-test/unit/panels/display/display_test.js] start testing > start test display module > initBrightnessItems without ambientLight:

ReferenceError: MockNavigatorSettings is not defined

at set (app://settings.gaiamobile.org/shared/test/unit/mocks/mock_settings_listener.js?bust=1404151664157:13:5)

at d_init_brightness_items (app://settings.gaiamobile.org/js/panels/display/display.js?bust=1404151664157:57:9)

at (anonymous) (app://settings.gaiamobile.org/test/unit/panels/display/display_test.js:63:7)



I'll use the same fix than in bug 1016429.
(Assignee)

Comment 1

4 years ago
Created attachment 8448136 [details] [review]
github PR
Attachment #8448136 - Flags: review?(arthur.chen)
Hi Julien,

Could you try if adding "deps: ['shared_mocks/mock_navigator_moz_settings']" after this line [1] helps?

[1] https://github.com/mozilla-b2g/gaia/blob/master/apps/settings/test/unit/setup.js#L55
Flags: needinfo?(felash)
(Assignee)

Comment 3

4 years ago
Yes, this works fine

I'll add it and also revert the change I did in bug 1016429 then :)
Flags: needinfo?(felash)
(Assignee)

Updated

4 years ago
Attachment #8448136 - Flags: review?(arthur.chen)
(Assignee)

Comment 4

4 years ago
pushed a new version.

Will wait for the Travis run with the patch for bug 874510 before requesting a review.
https://travis-ci.org/mozilla-b2g/gaia/builds/29308895
(Assignee)

Comment 5

4 years ago
Comment on attachment 8448136 [details] [review]
github PR

Green on master: https://travis-ci.org/mozilla-b2g/gaia/builds/29308837
Green with the new mocha: https://travis-ci.org/mozilla-b2g/gaia/builds/29308895

Thanks for the tip with "deps", it looks a lot cleaner !
Attachment #8448136 - Flags: review?(arthur.chen)
Comment on attachment 8448136 [details] [review]
github PR

Cool! r=me, thanks.
Attachment #8448136 - Flags: review?(arthur.chen) → review+
(Assignee)

Comment 7

4 years ago
master: 1e6083654b2bdd9cf12b6d05b7dacff1e4d159cc
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.