[remote-dbg-next] fix jest test after try supports node version (+10)

RESOLVED FIXED in Firefox 69

Status

defect
P1
normal
RESOLVED FIXED
4 months ago
3 months ago

People

(Reporter: ogasidlo, Assigned: ogasidlo)

Tracking

(Depends on 1 bug, Blocks 1 bug)

unspecified
Firefox 69
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox69 fixed)

Details

Attachments

(1 attachment)

Follow up for 1546370

When trying to run the jest test with yarn test, await could not be parsed.

Our fluent-react package was causing this as the message component is using fluent, so did also the related jest test.

~/mozilla-central/devtools/client/shared/vendor/fluent.js: Unexpected token, expected ( (1996:8)

        1994 | async function mapContextAsync(iterable, ids) {
        1995 |   if (!Array.isArray(ids)) {
      > 1996 |     for await (const context of iterable) {
             |         ^
        1997 |       if (context.hasMessage(ids)) {
        1998 |         return context;
        1999 |       }

This is why a syntax-plugin for babel was added and the Node as well as Jest version bumped.

https://searchfox.org/mozilla-central/source/devtools/client/aboutdebugging-new/test/jest/package.json

"node": ">=8.9.4" -> "node": ">=10.0.0"
"jest": "^23.0.0", -> "jest": "^24.6.0",

"devDependencies": {
    "babel-plugin-transform-async-generator-functions": "^6.24.1"
  }

To make sure, babel is able to use the syntax plugin, a .babelrc was created and the plugin registered.

{
    "plugins": ["syntax-async-generators"]
}
Priority: -- → P3
See Also: → 1546341
Assignee: nobody → ogasidlo
Status: NEW → ASSIGNED
Priority: P3 → P1
Pushed by ogasidlo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/236ca3d1f3d3
Fix jest tests with localization, r=ladybenko,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
You need to log in before you can comment on or make changes to this bug.