Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest tests are failing due to some node_modules not being transpiled before loading #111

Closed
academo opened this issue Oct 24, 2022 · 1 comment · Fixed by #112 or #145
Closed

Jest tests are failing due to some node_modules not being transpiled before loading #111

academo opened this issue Oct 24, 2022 · 1 comment · Fixed by #112 or #145
Assignees
Labels
released This issue/pull request has been released.
Milestone

Comments

@academo
Copy link
Member

academo commented Oct 24, 2022

Similar to #108 other dependencies like react-colorful or esm-browser are causing problems because they need to be transpiled before jest can loaded.

Context

When jest load tests it also needs to load the code dependencies from node_modules. Those dependencies sometimes need transformation before jest can load them otherwise nodejs can't run them. e.g.: because they are written in typescript or they are ESM that some nodejs version don't understand.

Jest has a configuration list of regex that tells it which packages should not transform, by default jest won't transform any module inside node_modules.

This previous PR created an exception for the package ol: open layers but there are much more packages that will have this problem and fail to run inside jest.

Suggested solutions:

  • Create and maintain a list of packages that should be transformed by jest and keep the list up to date
  • Ask jest to transform all packages regardless if they need transformation or not
  • Let the users maintain the list of packages on their own
@academo academo added the bug label Oct 24, 2022
@academo academo added this to the v1.0.0 milestone Oct 24, 2022
@academo academo self-assigned this Oct 24, 2022
@academo academo moved this to 📬 Uncategorized in Plugins Platform / Grafana Community Oct 24, 2022
@academo academo moved this from 📬 Uncategorized to 🧑‍💻 In development (Limit 6) in Plugins Platform / Grafana Community Oct 24, 2022
Repository owner moved this from 🧑‍💻 In development (Limit 6) to 🚀 Shipped in Plugins Platform / Grafana Community Oct 25, 2022
@grafanabot
Copy link
Contributor

🚀 Issue was released in @grafana/create-plugin@0.5.3 🚀

@grafanabot grafanabot added the released This issue/pull request has been released. label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
2 participants