Jest and vue/compat #10797
-
Hi all We have set up a alias resolve for Webpack in chainWebpack: (config) => {
config.resolve.alias.set('vue', '@vue/compat')
config.module
.rule('vue')
.use('vue-loader')
.tap((options) => {
return {
...options,
compilerOptions: {
compatConfig: {
MODE: 2,
},
},
}
})
}, But when it comes to Jest testing, it ignores this config. I am trying to figure how to do similar for Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I seem to have gotten Bootstrap-Vue working in the Jest tests, when using vue/compat with Vue 3. In moduleNameMapper: {
'^vue$': '@vue/compat',
}, I could not fugure where to apply the setupFiles: ['<rootDir>/setup'],
import { configureCompat } from 'vue'
configureCompat({
.
.
.
}) |
Beta Was this translation helpful? Give feedback.
I seem to have gotten Bootstrap-Vue working in the Jest tests, when using vue/compat with Vue 3.
In
jest.config.js
, I have applied the alias tomoduleNameMapper
:I could not fugure where to apply the
compatConfig
mode, so instead I added theconfigureCompat()
function to a setup file viajest.config.js
setupFiles
:setup.js
: