From 46757bd5ef91ec053c341e9ae19ff7ed366438be Mon Sep 17 00:00:00 2001 From: lana-k Date: Sun, 28 Feb 2021 21:27:10 +0100 Subject: [PATCH] exclude router/index.js from coverage --- karma.files.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/karma.files.js b/karma.files.js index f445889..1b89acd 100644 --- a/karma.files.js +++ b/karma.files.js @@ -13,8 +13,9 @@ const testsContext = require.context('./tests/unit', true, /\.spec.js$/) // https://www.npmjs.com/package/require-context#context-api testsContext.keys().forEach(testsContext) -// require all src files except main.js for coverage. +// require all src files except main.js and router/index.js for coverage. // you can also change this to match only the subset of files that // you want coverage for. -const srcContext = require.context('./src', true, /^\.\/(?!main(\.js)?$)/) +// We don't include router/index.js to avoid installing VueRouter globally in tests +const srcContext = require.context('./src', true, /^\.\/(?!(main|(router(\/)?(index)?))(\.js)?$)/) srcContext.keys().forEach(srcContext)