vuejs / vue-jest

Jest Vue transformer
MIT License
748 stars 156 forks source link

Can't run jest with error "Cannot find module '../../Notifications.vue' or its corresponding type declarations." #508

Closed websitevirtuoso closed 2 years ago

websitevirtuoso commented 2 years ago

I am trying to add latest version of jest to my project but it doesn't work. Sorry for this config file

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
  preset: 'ts-jest',
  testEnvironment: 'node',
  testRegex: 'unit/.*.spec.ts$',
  transform: {
    '^.+\\.vue$': '@vue/vue3-jest',
  },
}

package.json

"jest": "^29.2.2",
"jest-environment-jsdom": "^29.2.2",
"ts-jest": "^29.0.3",
"@vue/vue3-jest": "^29.2.0",
"babel-jest": "^29.2.2",
"babel-core": "^7.0.0-bridge.0",

Can't import any vue file into  project for tests
dschmidt commented 1 year ago

How did you solve it?

websitevirtuoso commented 1 year ago

I removed jest and moved to vitest