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

nx upgrade: failed to run unit test case (transformIgnorePatterns is not working for d3 packages ) #9226

Closed
dean-g opened this issue Mar 7, 2022 · 10 comments
Assignees
Labels
blocked: repro needed outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx stale type: bug

Comments

@dean-g
Copy link

dean-g commented Mar 7, 2022

I am trying to upgrade the packages and getting the following error while running my jest unit test case,

TypeError: import_index.Selection is not a constructor

It looks like, the following global jest.preset.js configuration is not working with the latest version on nx,

const d3Modules = ['d3', 'd3-array', 'd3-selection'].join('|');
transformIgnorePatterns: [`node_modules/(?!${d3Modules}|.*.mjs$)`],

Can you please advise if anything needs to be changed on that to get my d3 packages ignored?

The same worked well with the following version 13.7.2

@dean-g
Copy link
Author

dean-g commented Mar 8, 2022

the jest-preset-angular package upgrade is an issue!. if I downgrade this, everything works well

@AgentEnder AgentEnder added the scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx label Mar 14, 2022
@barbados-clemens
Copy link
Contributor

@dean-g which version did you use to solve the issue for you?

@zoechi
Copy link

zoechi commented Apr 13, 2022

I got this error when I upgraded from 11.0.1 to 11.1.1, but downgrading didn't fix it, so it's probably caused by something else

@barbados-clemens
Copy link
Contributor

@zoechi can you provide a reproducible repo I can take a look at?

@zoechi
Copy link

zoechi commented Apr 14, 2022

@barbados-clemens sorry, it's a closed source project. I'll update though if I find any clues.

@barbados-clemens
Copy link
Contributor

@zoechi are you using babel-jest for the project that isn't working?

Came across this issue where the transformIngorePatterns "wasn't working" because babel-jest wasn't picking up a config for transforming the node_modules. so it looked like it wasn't working, but just needed a config for babel to use #9640

@github-actions
Copy link

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@bmordue
Copy link

bmordue commented May 17, 2022

I'm struggling with a similar issue, except I'm starting from scratch, no upgrade.
I think this example repo shows the problem: https://github.com/bmordue/nx-bmordue
GH action log with OP's error message: https://github.com/bmordue/nx-bmordue/runs/6469344545?check_suite_focus=true#step:4:13
Thanks for looking!

@joewIST
Copy link

joewIST commented May 17, 2022

This is also an issue for our project, and I can confirm that downgrading jest-present-angular to 11.0.1 has no impact. we are seeing many instances of the following error: "TypeError: import_index.Selection is not a constructor"

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: repro needed outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx stale type: bug
Projects
None yet
Development

No branches or pull requests

6 participants