mirror of https://github.com/waku-org/js-waku.git
Import Karma settings instead of duplicating them
This commit is contained in:
parent
8e591f22db
commit
99763322db
|
@ -1,45 +1,16 @@
|
|||
process.env.CHROME_BIN = require('puppeteer').executablePath();
|
||||
// import settings from default config file
|
||||
let properties = null;
|
||||
const originalConfigFn = require('./karma.conf.js');
|
||||
originalConfigFn({
|
||||
set: function (arg) {
|
||||
properties = arg;
|
||||
},
|
||||
});
|
||||
|
||||
// pass `--grep '[live data]'` to mocha to only run live data tests
|
||||
properties.client.args = ['--grep', '[live data]]'];
|
||||
|
||||
// export settings
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
frameworks: ['mocha', 'karma-typescript'],
|
||||
files: ['src/lib/**/*.ts', 'src/proto/**/*.ts'],
|
||||
preprocessors: {
|
||||
'**/*.ts': ['karma-typescript'],
|
||||
},
|
||||
plugins: [
|
||||
require('karma-mocha'),
|
||||
require('karma-typescript'),
|
||||
require('karma-chrome-launcher'),
|
||||
],
|
||||
reporters: ['progress', 'karma-typescript'],
|
||||
browsers: ['ChromeHeadless'],
|
||||
singleRun: true,
|
||||
client: {
|
||||
mocha: {
|
||||
timeout: 6000, // Default is 2s
|
||||
},
|
||||
args: ['--grep', '[live data]]'],
|
||||
},
|
||||
karmaTypescriptConfig: {
|
||||
bundlerOptions: {
|
||||
entrypoints: /^.*[^(node)]\.spec\.ts$/,
|
||||
},
|
||||
coverageOptions: {
|
||||
instrumentation: false,
|
||||
},
|
||||
tsconfig: './tsconfig.json',
|
||||
compilerOptions: {
|
||||
noEmit: false,
|
||||
},
|
||||
include: {
|
||||
mode: 'replace',
|
||||
values: ['src/lib/**/*.ts', 'src/proto/**/*.ts'],
|
||||
},
|
||||
exclude: {
|
||||
mode: 'replace',
|
||||
values: ['node_modules/**'],
|
||||
},
|
||||
},
|
||||
});
|
||||
config.set(properties);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue