Skip to content

Commit

Permalink
use test instead of test:coverage in config.yml, disable code and lin…
Browse files Browse the repository at this point in the history
…k to issue to enable coverage in Vue <template>s
  • Loading branch information
trusktr committed Mar 22, 2022
1 parent eab57e6 commit 4f5e8ec
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
steps:
- browser-tools/install-chrome:
replace-existing: false
- run: npm run test:coverage -- --browsers=<<parameters.browser>>
- run: npm run test -- --browsers=<<parameters.browser>>
- save_cache_cmd:
node-version: <<parameters.node-version>>
- store_test_results:
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"vue": "2.6.14",
"vue-eslint-parser": "8.2.0",
"vue-loader": "15.9.8",
"vue-template-babel-compiler": "^1.0.7",
"vue-template-compiler": "2.6.14",
"webpack": "5.68.0",
"webpack-cli": "4.9.2",
Expand All @@ -89,9 +88,8 @@
"build:watch": "webpack --config webpack.dev.js --watch",
"info": "npx envinfo --system --browsers --npmPackages --binaries --languages --markdown",
"test": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run",
"test:firefox": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run --browsers=FirefoxHeadless",
"test:debug": "cross-env NODE_ENV=debug karma start --no-single-run",
"test:coverage": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" COVERAGE=true karma start --single-run",
"test:coverage:firefox": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" COVERAGE=true karma start --single-run --browsers=FirefoxHeadless",
"test:e2e:ci": "npx playwright test --config=e2e/playwright-ci.config.js --project=chrome smoke default condition timeConductor",
"test:e2e:local": "npx playwright test --config=e2e/playwright-local.config.js --project=chrome",
"test:e2e:visual": "percy exec --config ./e2e/.percy.yml -- npx playwright test --config=e2e/playwright-visual.config.js default",
Expand Down
20 changes: 13 additions & 7 deletions webpack.coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ config.devtool = false;
const vueLoaderRule = config.module.rules.find(r => r.use === 'vue-loader');

vueLoaderRule.use = {
loader: 'vue-loader',
loader: 'vue-loader'
// Attempt to use Babel with babel-plugin-istanbul
options: {
compiler: require('vue-template-babel-compiler'),
compilerOptions: {
babelOptions: require('./babel.coverage')
}
}

// TODO The purpose of this was to try to add coverage to JS expressions
// inside `<template>` markup, but it seems to add only coverage inside
// `<script>` tags.
// Issue: https://github.com/nasa/openmct/issues/4973
//
// options: {
// compiler: require('vue-template-babel-compiler'),
// compilerOptions: {
// babelOptions: require('./babel.coverage')
// }
// }
};

config.module.rules.push({
Expand Down

0 comments on commit 4f5e8ec

Please sign in to comment.