-
Notifications
You must be signed in to change notification settings - Fork 68
#227: Webpack code coverage support #266
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
base: dev
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| * | ||
| * API: https://github.com/quasarframework/quasar/blob/master/app/lib/app-extension/IndexAPI.js | ||
| */ | ||
| const path = require('path'); | ||
|
|
||
| module.exports = async function (api) { | ||
| api.compatibleWith('quasar', '^2.0.0'); | ||
|
|
@@ -40,10 +41,18 @@ module.exports = async function (api) { | |
| ); | ||
| }); | ||
| } else { | ||
| // TODO: add webpack code coverage support | ||
| // See https://www.npmjs.com/package/istanbul-instrumenter-loader | ||
| // https://github.com/vuejs/vue-cli/issues/1363#issuecomment-405352542 | ||
| // https://github.com/akoidan/vue-webpack-typescript | ||
| if (api.hasWebpack === true) { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @IlCallo When I've tried then
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| api.extendWebpack((cfg) => { | ||
| cfg.module.rules.push({ | ||
| test: /\.(js|ts|vue)$/, | ||
| loader: '@jsdevtools/coverage-istanbul-loader', | ||
| options: { esModules: true }, | ||
| enforce: 'post', | ||
| include: path.join(__dirname, '..', '..', '..', '..', 'src'), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems off, the include (provided the exclude isn't enough on its own) should be relative the the user folder, not to this AE location
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed |
||
| exclude: [/\.(e2e|spec)\.(js|ts)$/, /node_modules/], | ||
| }); | ||
| }); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember that the Cypress AE devDeps are the ones which are used into dev phase of the app extension, while packages which must be used into userland project must go into the app extension normal dependencies
So this package should be moved to
dependenciesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I fixed it.