Skip to content

Commit

Permalink
Move file
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Feb 6, 2022
1 parent 5f36e49 commit d3310a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
13 changes: 2 additions & 11 deletions src/config/plugin/lib/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { normalizeReporters } from '../../../report/config/main.js'

import { getPluginTypes, getTopConfig, removeTopProps } from './extract.js'
import { loadPlugins } from './load.js'
import { normalizeMainProps } from './main_props.js'
Expand All @@ -9,12 +7,7 @@ import { normalizeMainProps } from './main_props.js'
// - Plugins without configuration
// - Single plugin per type, as opposed to multiple
// - Single configuration per plugin
export const addPlugins = async function ({
config,
command,
context,
configInfos,
}) {
export const addPlugins = async function (config, context, configInfos) {
const pluginTypes = getPluginTypes()
const pluginsConfigs = await addPluginsProps({
config,
Expand All @@ -23,9 +16,7 @@ export const addPlugins = async function ({
configInfos,
})
const configA = removeTopProps(config, pluginTypes)
const configB = { ...configA, ...pluginsConfigs }
const configC = normalizeReporters(configB, command)
return configC
return { ...configA, ...pluginsConfigs }
}

const addPluginsProps = async function ({
Expand Down
11 changes: 5 additions & 6 deletions src/config/plugin/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { normalizeReporters } from '../../report/config/main.js'

import { addPlugins } from './lib/main.js'

// Handle the configuration all spyd-specific plugins: reporters and runners
Expand All @@ -7,10 +9,7 @@ export const normalizePluginsConfig = async function ({
context,
configInfos,
}) {
return await addPlugins({
config,
command,
context,
configInfos,
})
const configA = await addPlugins(config, context, configInfos)
const configB = normalizeReporters(configA, command)
return configB
}

0 comments on commit d3310a7

Please sign in to comment.