vuetify: [Bug Report][2.5.5] Vuetify and Jest are not working with TSX

Environment

Vuetify Version: 2.5.5 Vue Version: 2.6.12 Browsers: Chrome 91.0.4472.114 OS: Windows 10

Steps to reproduce

  1. yarn (install deps)
  2. yarn test (tests should fail)

Uncomment transformIgnorePatterns: ["node_modules/(?!(vuetify)/)"], line in jest.config.js to make tests pass.

Expected Behavior

Tests are passing without transformIgnorePatterns: ["node_modules/(?!(vuetify)/)"],

Actual Behavior

Tests are failing without transformIgnorePatterns: ["node_modules/(?!(vuetify)/)"],

Reproduction Link

https://github.com/Maxim-Mazurok/vue-jest-tsx-error-repro/tree/vuetify

Other comments

See also: https://github.com/wonderful-panda/vue-tsx-support/issues/78 which was fixed.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Oops

- '^vuetify/lib': 'vuetify/es5/entry-lib',
+ '^vuetify/lib$': 'vuetify/es5/entry-lib',

Ok that’s my bad looks like /es5 uses the same entry as the UMD build which doesn’t re-export components. It takes two maps to fix this:

  moduleNameMapper: {
    '^vuetify/lib': 'vuetify/es5/entry-lib',
    '^vuetify/lib/(.*)': 'vuetify/es5/$1',
  }