mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
fix test coverage
This commit is contained in:
@@ -18,7 +18,7 @@ module.exports = function(config) {
|
|||||||
|
|
||||||
// list of files / patterns to load in the browser
|
// list of files / patterns to load in the browser
|
||||||
files: [
|
files: [
|
||||||
"tests/unit/*.spec.js",
|
"./karma.files.js",
|
||||||
{ pattern: 'node_modules/sql.js/dist/sql-wasm.wasm',
|
{ pattern: 'node_modules/sql.js/dist/sql-wasm.wasm',
|
||||||
watched: false,
|
watched: false,
|
||||||
included: false,
|
included: false,
|
||||||
@@ -39,7 +39,7 @@ module.exports = function(config) {
|
|||||||
// preprocess matching files before serving them to the browser
|
// preprocess matching files before serving them to the browser
|
||||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
"tests/unit/*.spec.js": ["webpack"]
|
"./karma.files.js": ["webpack"]
|
||||||
},
|
},
|
||||||
|
|
||||||
// test results reporter to use
|
// test results reporter to use
|
||||||
@@ -118,7 +118,14 @@ module.exports = function(config) {
|
|||||||
use: [
|
use: [
|
||||||
{
|
{
|
||||||
loader: "babel-loader"
|
loader: "babel-loader"
|
||||||
},
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
include: /src/,
|
||||||
|
exclude: /(node_modules|bower_components|\.spec\.js$|\/file)/,
|
||||||
|
use: [
|
||||||
{
|
{
|
||||||
loader: "istanbul-instrumenter-loader",
|
loader: "istanbul-instrumenter-loader",
|
||||||
options: {
|
options: {
|
||||||
|
|||||||
16
karma.files.js
Normal file
16
karma.files.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import Vue from "vue";
|
||||||
|
|
||||||
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
|
// require all test files (files that ends with .spec.js)
|
||||||
|
const testsContext = require.context("./tests/unit", true, /\.spec.js$/);
|
||||||
|
|
||||||
|
// Read more about why we need to call testContext:
|
||||||
|
// https://www.npmjs.com/package/require-context#context-api
|
||||||
|
testsContext.keys().forEach(testsContext);
|
||||||
|
|
||||||
|
// require all src files except main.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)?$)/);
|
||||||
|
srcContext.keys().forEach(srcContext);
|
||||||
Reference in New Issue
Block a user