[remote-dbg-next] fix jest test failing on try due to not supported node version (+10)
Categories
(DevTools :: about:debugging, defect, P1)
Tracking
(firefox68 fixed)
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: ogasidlo, Assigned: ogasidlo)
References
(Blocks 1 open bug)
Details
(Whiteboard: [remote-debugging-reserve] remote-debugging-technical-debt)
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Jest tests are failing on try due to not supported node version.
https://treeherder.mozilla.org/logviewer.html#?job_id=242008678&repo=autoland&lineNumber=275
We'll decided to back out this change and document here how to fix it in the future when we support Node >=10 on try.
To make sure, we do not need to solve this issue again, I'll document the fix here.
=========== PROGRESS + FIX ===========
The initial issue was following:
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"]
}
Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Pushed by ogasidlo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d29767eb7247 Revert Node + Jest version bump r=jdescottes,ladybenko
Comment 4•5 years ago
|
||
bugherder |
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 5•5 years ago
|
||
Let's use follow up bugs. We have no idea when/if the newly filed bug will be resolved.
The goal here was to fix the jest tests running on try. This has been achieved, patches have landed, so let's keep this bug closed.
New work should be tracked in new bugs.
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Description
•