vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.77k stars 6.33k forks source link

Error run unit test: jest , vuetify #7439

Open rock288 opened 7 months ago

rock288 commented 7 months ago

Version

5.0.8

Reproduction link

cli.vuejs.org/config/

Environment info

Environment Info:

  System:
    OS: Windows 11 10.0.22621
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11400 @ 2.60GHz
  Binaries:
    Node: 18.18.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.22621.819.0), Chromium (119.0.2151.93)
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.4.0
    @vue/babel-helper-vue-transform-on:  1.1.5
    @vue/babel-plugin-jsx:  1.1.5
    @vue/babel-plugin-transform-vue-jsx:  1.4.0
    @vue/babel-preset-app:  5.0.8
    @vue/babel-preset-jsx:  1.4.0
    @vue/babel-sugar-composition-api-inject-h:  1.4.0
    @vue/babel-sugar-composition-api-render-instance:  1.4.0
    @vue/babel-sugar-functional-vue:  1.4.0
    @vue/babel-sugar-inject-h:  1.4.0
    @vue/babel-sugar-v-model:  1.4.0
    @vue/babel-sugar-v-on:  1.4.0
    @vue/cli-overlay:  5.0.8
    @vue/cli-plugin-babel: ~5.0.0 => 5.0.8
    @vue/cli-plugin-e2e-cypress: ~5.0.0 => 5.0.8
    @vue/cli-plugin-eslint: ~5.0.0 => 5.0.8
    @vue/cli-plugin-pwa: ~5.0.0 => 5.0.8
    @vue/cli-plugin-router: ~5.0.0 => 5.0.8
    @vue/cli-plugin-typescript: ~5.0.0 => 5.0.8
    @vue/cli-plugin-unit-jest: ~5.0.0 => 5.0.8
    @vue/cli-plugin-vuex: ~5.0.0 => 5.0.8
    @vue/cli-service: ~5.0.0 => 5.0.8
    @vue/cli-shared-utils:  5.0.8
    @vue/compiler-core:  3.3.8
    @vue/compiler-dom:  3.3.8
    @vue/compiler-sfc:  3.3.8
    @vue/compiler-ssr:  3.3.8
    @vue/component-compiler-utils:  3.3.0
    @vue/devtools-api:  6.5.1
    @vue/eslint-config-typescript: ^9.1.0 => 9.1.0
    @vue/reactivity:  3.3.8
    @vue/reactivity-transform:  3.3.8
    @vue/runtime-core:  3.3.8
    @vue/runtime-dom:  3.3.8
    @vue/server-renderer:  3.3.8
    @vue/shared:  3.3.8
    @vue/test-utils: ^2.0.0-0 => 2.4.3
    @vue/vue3-jest: ^27.0.0-alpha.1 => 27.0.0
    @vue/web-component-wrapper:  1.3.0
    eslint-plugin-vue: ^8.0.3 => 8.7.1 (9.18.1)
    jest-serializer-vue:  2.0.2
    typescript: ~4.5.5 => 4.5.5 (4.9.5)
    vue: ^3.2.13 => 3.3.8
    vue-component-type-helpers:  1.8.24
    vue-demi:  0.14.6
    vue-eslint-parser:  8.3.0 (9.3.2)
    vue-facing-decorator: ^3.0.4 => 3.0.4
    vue-final-modal: ^4.4.6 => 4.4.6
    vue-hot-reload-api:  2.3.4
    vue-loader:  17.3.1 (15.11.1)
    vue-router: ^4.0.3 => 4.2.5
    vue-style-loader:  4.1.3
    vue-template-es2015-compiler:  1.9.1
    vuetify: ^3.4.3 => 3.4.3
    vuex: ^4.0.0 => 4.1.0
    youtube-vue3: ^0.1.15 => 0.1.15
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  1. Vue create name-project ( jest, ts)
  2. cd name-project
  3. yarn add vuetify ( add to main.js )
  4. In component HelloWorld.vue add test
  5. In file tests/unit/example.spec.ts add import { createVuetify } from 'vuetify'; import as components from 'vuetify/components'; import as directives from 'vuetify/directives'; import Login from '@/views/login.vue';

const vuetify = createVuetify({ components, directives, });

  1. yarn run test:unit

What is expected?

Fix error message and run test:unit sucessfully

What is actually happening?

-> error message: C:\computer-a\sources\project-name\node_modules\vuetify\lib\framework.mjs:2 import { createDate, DateAdapterSymbol, DateOptionsSymbol } from "./composables/date/date.mjs";

andreialecsandrica-mhc commented 1 month ago

I have the same issue did you manage to fix it?