mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
make coverage generation optional
This commit is contained in:
parent
9e1488ebbb
commit
d6f4a1f829
2 changed files with 16 additions and 7 deletions
|
@ -6,10 +6,17 @@ module.exports = (kibana) => {
|
|||
let findSourceFiles = utils('findSourceFiles');
|
||||
|
||||
return new kibana.Plugin({
|
||||
config: (Joi) => {
|
||||
return Joi.object({
|
||||
enabled: Joi.boolean().default(true),
|
||||
instrument: Joi.boolean().default(false)
|
||||
}).default();
|
||||
},
|
||||
|
||||
uiExports: {
|
||||
bundle: async (UiBundle, env, apps) => {
|
||||
|
||||
let modules = [];
|
||||
let config = kibana.config;
|
||||
|
||||
// add the modules from all of the apps
|
||||
for (let app of apps) {
|
||||
|
@ -23,11 +30,13 @@ module.exports = (kibana) => {
|
|||
|
||||
for (let f of testFiles) modules.push(f);
|
||||
|
||||
env.addPostLoader({
|
||||
test: /\.jsx?$/,
|
||||
exclude: /[\/\\](__tests__|node_modules|bower_components|webpackShims)[\/\\]/,
|
||||
loader: 'istanbul-instrumenter'
|
||||
});
|
||||
if (config.get('testsBundle.instrument')) {
|
||||
env.addPostLoader({
|
||||
test: /\.jsx?$/,
|
||||
exclude: /[\/\\](__tests__|node_modules|bower_components|webpackShims)[\/\\]/,
|
||||
loader: 'istanbul-instrumenter'
|
||||
});
|
||||
}
|
||||
|
||||
return new UiBundle({
|
||||
id: 'tests',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name": "tests_bundle",
|
||||
"name": "testsBundle",
|
||||
"version": "0.0.0"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue