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
"TypeError: babelJest.getCacheKey is not a function" issue occurred
when running the jest test immediately after executing "nx g @nx-plus/vue:app auto-trading".
npx nx test auto-trading
The cause is shallowMount. code
If I annotation out shallowMount it works.
import{shallowMount}from'@vue/test-utils';importHelloWorldfrom'../../src/components/HelloWorld.vue';describe('HelloWorld.vue',()=>{it('renders props.msg when passed',()=>{constmsg='new message';constwrapper=shallowMount(HelloWorld,{props: { msg },});expect(wrapper.text()).toMatch(msg);});});
Steps to Reproduce
## step 1 : Nx Workspacenpx create-nx-workspace@^14.0.0## step 2 : Peer Dependenciesyarn add @nrwl/cypress@^14.0.0 @nrwl/jest@^14.0.0 @nrwl/linter@^14.0.0 --dev## step 3 : nx-plus/vue plugin installyarn add @nx-plus/vue --dev## step 4 : generate appnpx nx g @nx-plus/vue:app auto-trading (all default option selected) name: auto-trading babel with Typescript : false vue version ? : 3## step 5 : run jest Test npx nx test auto-trading
This issue may not be prioritized if details are not provided to help us reproduce the issue.
Failure Logs
npx nx test auto-trading
then faill
nx run auto-trading:test
FAIL auto-trading apps/auto-trading/tests/unit/example.spec.ts
● Test suite failed to run
TypeError: babelJest.getCacheKey is not a function
at Object.getCacheKey (../../node_modules/vue3-jest/lib/index.js:13:19)
at ScriptTransformer._getCacheKey (../../node_modules/@jest/transform/build/ScriptTransformer.js:278:41)
at ScriptTransformer._getFileCachePath (../../node_modules/@jest/transform/build/ScriptTransformer.js:349:27)
at ScriptTransformer.transformSource (../../node_modules/@jest/transform/build/ScriptTransformer.js:595:32)
at ScriptTransformer._transformAndBuildScript (../../node_modules/@jest/transform/build/ScriptTransformer.js:765:40)
at ScriptTransformer.transform (../../node_modules/@jest/transform/build/ScriptTransformer.js:822:19)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.361 s
Ran all test suites.
Environment
Plugin name and version:
yarn version : 1.22.19
node : v16.14.2
I have recently published @nx-plus/[email protected] which now used vue-cli v5 (webpack 5). I haven't published any docs/migrations yet but if you're curious you can try it out! It requires v15 of Nx.
I'm going to be working over the next week to write some docs and migrations so stay tuned!
Current Behavior
"TypeError: babelJest.getCacheKey is not a function" issue occurred
when running the jest test immediately after executing "nx g @nx-plus/vue:app auto-trading".
npx nx test auto-trading
The cause is shallowMount. code
If I annotation out shallowMount it works.
then success
Expected Behavior
I would like to see vue component tests.
Steps to Reproduce
This issue may not be prioritized if details are not provided to help us reproduce the issue.
Failure Logs
npx nx test auto-trading
then faill
nx run auto-trading:test FAIL auto-trading apps/auto-trading/tests/unit/example.spec.ts ● Test suite failed to run TypeError: babelJest.getCacheKey is not a function at Object.getCacheKey (../../node_modules/vue3-jest/lib/index.js:13:19) at ScriptTransformer._getCacheKey (../../node_modules/@jest/transform/build/ScriptTransformer.js:278:41) at ScriptTransformer._getFileCachePath (../../node_modules/@jest/transform/build/ScriptTransformer.js:349:27) at ScriptTransformer.transformSource (../../node_modules/@jest/transform/build/ScriptTransformer.js:595:32) at ScriptTransformer._transformAndBuildScript (../../node_modules/@jest/transform/build/ScriptTransformer.js:765:40) at ScriptTransformer.transform (../../node_modules/@jest/transform/build/ScriptTransformer.js:822:19) Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total Time: 1.361 s Ran all test suites.
Environment
Plugin name and version:
yarn version : 1.22.19
node : v16.14.2
etc
mono root package.json
The text was updated successfully, but these errors were encountered: