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
Error "Cannot find module 'core-js/modules/es.typed-array.at.js' from ..." when executing Jest unit tests after upgrading from v5.0.0-beta.7 to v5.0.0-rc.0
#6830
Unfortunately, I don't know how to reproduce this.
What is expected?
Unit tests can be executed successfully as they can with v5.0.0-beta.7.
What is actually happening?
Some tests fail with the following error message:
FAIL tests/unit/views/ourtest.spec.ts
● Test suite failed to run
Cannot find module 'core-js/modules/es.typed-array.at.js' from '../shared/functions/any/src/folder/SomeShared.ts'
This happens only with some specific tests after upgrading from v5.0.0-beta.7 to v5.0.0-rc.0.
The text was updated successfully, but these errors were encountered:
The intention here is to just include some shared files from one central location (they are also used in another project).
So now, what happened was that the versions of core-js got out of sync:
node_modules 1 contained core-js 3.19.1
node_modules 2 contained core-js 3.6.5
And it seems that jest somehow tries to resolve core-js from node_modules 2" when executing the unit tests of project1(instead of resolving it fromnode_modules 1`).
Is jest somehow incorrectly configured for this setup?
A workaround is to install core-js in the same version in project2. Then the unit tests work again but it feels incorrect that jest (executed by vue-cli) tries to resolve core-js from project2 instead of project1 when the unit tests of project1 are executed.
Can this somehow be configured that it just takes the node_modules from the own project?
If that's no vue-cli issue, please let me know as I'm not ultimately sure where this comes from (whether it's from @vue/cli-plugin-unit-jest/presets/typescript-and-babel, jest, @vue/cli or an incorrect configuration).
Version
5.0.0-rc.0
Environment info
Steps to reproduce
Unfortunately, I don't know how to reproduce this.
What is expected?
Unit tests can be executed successfully as they can with v5.0.0-beta.7.
What is actually happening?
Some tests fail with the following error message:
This happens only with some specific tests after upgrading from v5.0.0-beta.7 to v5.0.0-rc.0.
The text was updated successfully, but these errors were encountered: