Skip to content

Commit

Permalink
Update deps, bump version (chartjs#310)
Browse files Browse the repository at this point in the history
* Update deps, bump version

* Remove leftover double dash
  • Loading branch information
kurkle authored Jan 14, 2021
1 parent 2602e4d commit f2cd85c
Show file tree
Hide file tree
Showing 3 changed files with 410 additions and 252 deletions.
10 changes: 4 additions & 6 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@ const istanbul = require('rollup-plugin-istanbul');
const resolve = require('@rollup/plugin-node-resolve').default;
const builds = require('./rollup.config');
const yargs = require('yargs');
const env = process.env.NODE_ENV;

module.exports = function(karma) {
const args = yargs
.option('verbose', {default: false})
.argv;

const grep = args.grep === true ? '' : args.grep;
const specPattern = 'test/specs/**/*' + grep + '*.js';

// Use the same rollup config as our dist files: when debugging (npm run dev),
// we will prefer the unminified build which is easier to browse and works
// better with source mapping. In other cases, pick the minified build to
// make sure that the minification process (terser) doesn't break anything.
const regex = karma.autoWatch ? /chartjs-plugin-annotation\.js$/ : /chartjs-plugin-annotation\.min\.js$/;
const build = builds.filter(v => v.output.file && v.output.file.match(regex))[0];

if (args.coverage) {
if (env === 'test') {
build.plugins = [
resolve(),
istanbul({exclude: ['node_modules/**/*.js', 'package.json']})
Expand Down Expand Up @@ -61,7 +59,7 @@ module.exports = function(karma) {
{pattern: 'node_modules/chart.js/dist/chart.js'},
{pattern: 'src/index.js', watched: false},
{pattern: 'test/index.js'},
{pattern: specPattern}
{pattern: 'test/specs/**/**.js'}
],

preprocessors: {
Expand Down Expand Up @@ -93,7 +91,7 @@ module.exports = function(karma) {
browserDisconnectTolerance: 3
});

if (args.coverage) {
if (env === 'test') {
karma.reporters.push('coverage');
karma.coverageReporter = {
dir: 'coverage/',
Expand Down
Loading

0 comments on commit f2cd85c

Please sign in to comment.