From 2cea81a51a8776c64f5a807e3bb75bf5738c2f9c Mon Sep 17 00:00:00 2001 From: ehmicky Date: Sun, 5 Jun 2022 23:25:43 +0200 Subject: [PATCH] Add parallelism --- src/report/reporters/plugin/main.js | 38 ++++++++++++++++------------- src/runners/plugin/main.js | 4 +-- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/report/reporters/plugin/main.js b/src/report/reporters/plugin/main.js index 15929f64..14f507e8 100644 --- a/src/report/reporters/plugin/main.js +++ b/src/report/reporters/plugin/main.js @@ -9,26 +9,30 @@ export const REPORTER_PLUGIN_TYPE = { modulePrefix: 'spyd-reporter', duplicates: true, builtins: BUILTIN_REPORTERS, - shape: [ + shape: new Set([ ...getReportMethods().map((name) => ({ name, schema: { typeof: 'function', errorMessage: 'must be a function' }, })), - { - name: 'capabilities', - default: {}, - schema: { type: 'object' }, - }, - { - name: 'capabilities.debugStats', - default: false, - schema: { type: 'boolean' }, - }, - { - name: 'capabilities.history', - default: false, - schema: { type: 'boolean' }, - }, + [ + { + name: 'capabilities', + default: {}, + schema: { type: 'object' }, + }, + new Set([ + { + name: 'capabilities.debugStats', + default: false, + schema: { type: 'boolean' }, + }, + { + name: 'capabilities.history', + default: false, + schema: { type: 'boolean' }, + }, + ]), + ], { name: 'defaultOutput', default: DEFAULT_REPORTER_OUTPUT, @@ -38,6 +42,6 @@ export const REPORTER_PLUGIN_TYPE = { errorMessage: { minLength: 'must not be an empty string' }, }, }, - ], + ]), shared, } diff --git a/src/runners/plugin/main.js b/src/runners/plugin/main.js index e3169bf3..46cc6f3e 100644 --- a/src/runners/plugin/main.js +++ b/src/runners/plugin/main.js @@ -17,13 +17,13 @@ export const RUNNER_PLUGIN_TYPE = { builtins: BUILTIN_RUNNERS, // Configuration rule for the plugin itself // Default: empty array - shape: [ + shape: new Set([ { name: 'launch', required: true, schema: { typeof: 'function', errorMessage: 'must be a function' }, }, - ], + ]), // Plugin configuration properties shared by all plugins // Default: empty array shared,