diff --git a/packages/baset-core/src/testGroup.ts b/packages/baset-core/src/testGroup.ts index 55c1eeb4..86d34920 100644 --- a/packages/baset-core/src/testGroup.ts +++ b/packages/baset-core/src/testGroup.ts @@ -23,6 +23,7 @@ export class TestGroup { private references = new WeakMap(); private pattern: RegExp; private readerChain: AbstractReader[]; + private allImports: string[]; constructor( pattern: string | RegExp, private options: ITestGroupOptions, @@ -37,8 +38,10 @@ export class TestGroup { return new reader(pluginsOptions[readerName]); }); - const baseliner: IBaselinerConstructor = require(path.resolve(baselinerName)).default; - this.baseliner = new baseliner(pluginsOptions[baselinerName]); + this.allImports = [ + options.environment, + ...options.imports, + ].filter((importName): importName is string => !!importName); } match = (filePath: string) => @@ -52,9 +55,7 @@ export class TestGroup { builtin: ['*'], context: 'sandbox', external: true, - import: this.environment - ? [this.environment] - : undefined, + import: this.allImports, }, compiler: compiler.compile, sourceExtensions: compiler.extensions,