-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any idea how to get this to use babel-plugin-istanbul for coverage in templates? #38
Comments
This lib works fine with babel-plugin-istanbul coverage test You may need:1. Add
|
Hello @JuniorTour, does that instrument JS expressions inside the |
Too long; didn't read:We can add instrument to template, but we have some obstacles from vue/component-compiler-utils We can add instrument to template, by add option // vue.config.js
module.exports = {
chainWebpack: (config) => {
config.module
.rule('vue')
.use('vue-loader')
.tap((options) => {
options.compilerOptions.babelOptions = {
filename: 'VueTemplateBabelCompilerCompiledRender.js',
}
options.compiler = require('vue-template-babel-compiler');
return options;
});
},
};
Then the render function from vue template will get instrument like this: function cov_1b2esh9sgc() {
// ...
}
cov_1b2esh9sgc()
var render = function {
// ...
} Because vue-template-babel-compiler use babel to compile the render function:
However,
|
I'm trying to do this in Webpack:
hoping it will, for example, add coverage instrumentation for JS expressions inside
<template>
, but no luck.Any ideas?
The text was updated successfully, but these errors were encountered: