Convert ActivityStreamPrefs.jsm to an ESM
Categories
(Firefox :: New Tab Page, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox122 | --- | fixed |
People
(Reporter: mconley, Assigned: mconley)
References
Details
(Whiteboard: [esmification-timeline] [hnt])
Attachments
(5 files)
What's blocking this work is that there are several mocha/chai tests under browser/components/newtab/test/unit/lib that fake out importing ActivityStreamPrefs.jsm using an injection tool that just won't work with ESMs.
This is blocking ESMification. This bug will update those tests to not use injection (which may require me to convert them to xpcshell tests), and then convert ActivityStreamPrefs.jsm to an ESM.
Assignee | ||
Updated•7 months ago
|
Updated•7 months ago
|
Assignee | ||
Comment 1•6 months ago
|
||
Hey Scott, so just keeping you in the loop on what I'm slogging through here - the mocha/chai environment that several newtab tests run in use a special injector to mock out / override some JSM loads in the mocha test runner environment. That injector is not compatible with ES6 modules.
I've tried a few approaches here, and unfortunately, I think the best way forward here is probably to convert those tests using the injection to xpcshell tests. This means giving up mocha/chai for those.
I'm in the midst of converting the following tests to xpcshell tests to avoid the injector for ActivityStreamPrefs.jsm:
- browser/components/newtab/test/unit/lib/Store.test.js
- browser/components/newtab/test/unit/lib/TopSitesFeed.test.js
- browser/components/newtab/test/unit/lib/TopStoriesFeed.test.js
Apologies in advance - these patches are not really going to be fun to review.
Assignee | ||
Comment 2•6 months ago
|
||
Assignee | ||
Comment 3•6 months ago
|
||
This is a handwritten conversion of the TopSitesFeed.test.js tests to
xpcshell. Along the way, some of the tests have been dropped - specifically,
tests for pseudoprivate methods on TopSitesFeed that start with _
.
The only exception is the Contile integration tests that call
._contile._fetchSites, as those seem fairly important to retain coverage for.
Depends on D192630
Assignee | ||
Comment 4•6 months ago
|
||
This feed is no longer in use by the main distribution of Firefox, and we're
not doing manual QA on it nor changing it. It's blocking our ability to migrate
to ESMs, so we're removing the test altogether. Someday soon, we can hopefully
remove TopStoriesFeed.jsm itself.
Depends on D193473
Assignee | ||
Comment 5•6 months ago
|
||
Depends on D193488
Assignee | ||
Comment 6•6 months ago
|
||
Depends on D193489
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fa50fe1f58d4 Convert Store.test.js to an xpcshell test. r=thecount https://hg.mozilla.org/integration/autoland/rev/6de5000684a8 Convert TopSitesFeed.test.js into an xpcshell test. r=thecount https://hg.mozilla.org/integration/autoland/rev/c388d81bf3be Remove TopStoriesFeed.test.js. r=thecount https://hg.mozilla.org/integration/autoland/rev/3a63a5894552 Adjust Istanbul coverage thresholds for Store.jsm and TopSitesFeed.jsm. r=thecount https://hg.mozilla.org/integration/autoland/rev/ae0d0f96b661 Convert ActivityStreamPrefs from a JSM to an ESM. r=thecount https://hg.mozilla.org/integration/autoland/rev/7044de24075f apply code formatting via Lando
Comment 8•5 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/fa50fe1f58d4
https://hg.mozilla.org/mozilla-central/rev/6de5000684a8
https://hg.mozilla.org/mozilla-central/rev/c388d81bf3be
https://hg.mozilla.org/mozilla-central/rev/3a63a5894552
https://hg.mozilla.org/mozilla-central/rev/ae0d0f96b661
https://hg.mozilla.org/mozilla-central/rev/7044de24075f
Description
•