You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are currently not able to run yarn rw test web in our CI check due to undiagnosed issues from the package linking process. I'm still tracking and including a manual QA check for yarn rw test web, however, it feels like it's bound to get missed sooner or later. What should the next steps be here:
diagnose and try to resolve via a change to package linking?
implement a different process for including yarn rw test in our CI process?
... ?
Example Jest failure message:
FAIL web web/src/components/BlogPostsCell/BlogPostsCell.test.js
● Test suite failed to run
Jest encountered an unexpected token
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Here's what you can do:
• If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/en/ecmascript-modules for how to enable it.
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html
Details:
/private/var/folders/gj/_y54h7q11mz9rwnhn16h6yrr0000gn/T/redwood-e2e/2021-03-23T15-48-36.323Z/packages/structure/dist/model/RWCell.js:3
import { withCell } from "@redwoodjs/web";
^^^^^^
SyntaxError: Cannot use import statement outside a module
33 | var _URL = require("../x/URL");
34 |
> 35 | var _RWCell = require("./RWCell");
| ^
36 |
37 | var _RWComponent = require("./RWComponent");
38 |
at Runtime.createScriptFromCode (../node_modules/jest-runtime/build/index.js:1350:14)
at Object.<anonymous> (../packages/structure/dist/model/RWProject.js:35:15)
How to Replicate
The error above came from an E2E run. However, I believe you can reproduce this on any project where you are using yarn rwt link ...
The text was updated successfully, but these errors were encountered:
What I found was that if you ran yarn rw test in e2e with the redwood/packages in the repository it didn't work, but if you ran yarn jest it did work.
I'm assuming there's a problem with paths, that jest doesn't know where it's starting from... Or "jest" is picking up tests or trying to do coverage in the redwood/packages folder.
bumping this on — likely too late for v0.29 but high priority when possible to dig in. I'm weak on the fundamentals here but game to dig in given direction.
related to #1886
@peterp @dac09
We are currently not able to run
yarn rw test web
in our CI check due to undiagnosed issues from the package linking process. I'm still tracking and including a manual QA check foryarn rw test web
, however, it feels like it's bound to get missed sooner or later. What should the next steps be here:yarn rw test
in our CI process?Example Jest failure message:
How to Replicate
The error above came from an E2E run. However, I believe you can reproduce this on any project where you are using
yarn rwt link ...
The text was updated successfully, but these errors were encountered: