chore: organize test files

This commit is contained in:
Igor Randjelovic
2020-12-01 19:25:29 +01:00
parent 65b214b845
commit 016ecd19a8
22 changed files with 339 additions and 140 deletions

View File

@ -1,8 +1,10 @@
import path from 'path';
import fs from 'fs';
import * as lib from '../index';
import { error, info, warn } from './log';
import { getAllDependencies, getDependencyPath } from './dependencies';
import { info, warn } from './log';
import * as lib from '../index';
import { clearCurrentPlugin, setCurrentPlugin } from '../index';
export function applyExternalConfigs() {
getAllDependencies().forEach((dependency) => {
@ -11,7 +13,7 @@ export function applyExternalConfigs() {
if (fs.existsSync(configPath)) {
info(`Discovered config: ${configPath}`);
setCurrentPlugin(dependency);
try {
const externalConfig = require(configPath);
@ -27,14 +29,13 @@ export function applyExternalConfigs() {
);
}
} catch (err) {
error(
`
Unable to apply config: ${configPath}.
Error is:
`,
err
);
warn(`
Unable to apply config: ${configPath}.
Error is: ${err}
`);
}
}
});
clearCurrentPlugin();
}