Closed Bug 1548465 Opened 5 years ago Closed 5 years ago

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

Categories

(DevTools :: about:debugging, defect, P1)

defect

Tracking

(firefox69 fixed)

RESOLVED FIXED
Firefox 69
Tracking Status
firefox69 --- fixed

People

(Reporter: ogasidlo, Assigned: ogasidlo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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
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: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: