jest测试注意点

module style

1
2
3
4
import Vue from 'vue';
import { CssModuleTestHelperMixin } from './test-helper.js';

Vue.use(CssModuleTestHelperMixin);
1
2
3
4
5
6
7
8
9
10
11
import objProxy from 'identity-obj-proxy';

export const CssModuleTestHelperMixin = {
install(Vue, options) {
Vue.mixin({
created() {
this.$style = objProxy;
},
});
},
};

ES6转换配置babel

1
2
3
4
5
6
7
8
9
10
11
module.exports = {
presets: [
'@vue/app',
[
'@babel/preset-env',
{
targets:
{ node: 'current' }
}],
],
};