@allurereport/core 3.6.2 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.js CHANGED
@@ -189,23 +189,27 @@ export const resolveConfig = async (config, override = {}) => {
189
189
  const output = resolve(override.output ?? config.output ?? "./allure-report");
190
190
  const known = await readKnownIssues(knownIssuesPath);
191
191
  const variables = config.variables ?? {};
192
- const configuredPlugins = override.plugins ?? config.plugins;
193
- const basePlugins = Object.keys(configuredPlugins ?? {}).length === 0
194
- ? {
195
- awesome: {
196
- options: {},
197
- },
198
- }
199
- : configuredPlugins;
200
- const plugins = hasConfiguredAgent(basePlugins)
201
- ? basePlugins
202
- : {
203
- ...basePlugins,
204
- agent: {
205
- options: {},
206
- },
207
- };
208
- const pluginInstances = await resolvePlugins(plugins);
192
+ let pluginInstances = [];
193
+ const hasPluginsOverride = override.plugins !== undefined;
194
+ if (!hasPluginsOverride || Object.keys(override.plugins ?? {}).length > 0) {
195
+ const configuredPlugins = hasPluginsOverride ? override.plugins : config.plugins;
196
+ const basePlugins = !hasPluginsOverride && Object.keys(configuredPlugins ?? {}).length === 0
197
+ ? {
198
+ awesome: {
199
+ options: {},
200
+ },
201
+ }
202
+ : configuredPlugins;
203
+ const plugins = hasConfiguredAgent(basePlugins)
204
+ ? basePlugins
205
+ : {
206
+ ...basePlugins,
207
+ agent: {
208
+ options: {},
209
+ },
210
+ };
211
+ pluginInstances = await resolvePlugins(plugins);
212
+ }
209
213
  return {
210
214
  name,
211
215
  output,
@@ -256,7 +260,7 @@ export const getPluginInstance = (config, predicate) => {
256
260
  return config?.plugins?.find(predicate);
257
261
  };
258
262
  const isModuleNotFoundError = (err) => {
259
- return err instanceof Error && "code" in err && err.code === "ERR_MODULE_NOT_FOUND";
263
+ return (err instanceof Error && "code" in err && (err.code === "ERR_MODULE_NOT_FOUND" || err.code === "MODULE_NOT_FOUND"));
260
264
  };
261
265
  export const resolvePlugin = async (path) => {
262
266
  if (!path.startsWith("@allurereport/plugin-")) {