Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tmpDir = mkdtempSync(join(tmpdir(), 'ngssc-'));
writeFileSync(join(tmpDir, 'environment.prod.ts'), envContent, 'utf8');
distDir = join(tmpDir, 'dist');
mkdirSync(distDir);
writeFileSync(join(distDir, 'main.js'), '', 'utf8');
architectHost = new TestingArchitectHost(tmpDir, tmpDir);
architect = new Architect(architectHost, registry);
// This will either take a Node package name, or a path to the directory
// for the package.json file.
await architectHost.addBuilderFromPackage('../../../..');
await architectHost.addBuilderFromPackage('..');
// Create a logger that keeps an array of all messages that were logged.
logger = new TestLogger('ngssc');
});
builder: any = {};
analytics = null;
target: Target = {
project: null,
target: null
};
get currentDirectory() {
return this.architectHost.currentDirectory;
}
get workspaceRoot() {
return this.architectHost.workspaceRoot;
}
logger = new TestLogger('test');
constructor(
private architect: Architect,
private architectHost: TestingArchitectHost
) {}
async addBuilderFromPackage(path: string) {
return await this.architectHost.addBuilderFromPackage(path);
}
async addTarget(target: Target, builderName: string) {
return await this.architectHost.addTarget(target, builderName);
}
getBuilderNameForTarget(target: Target) {
return this.architectHost.getBuilderNameForTarget(target);
}