test(ngcc): load standard files only once (#38840)
In the integration test suite of ngcc, we load a set of files from `node_modules` into memory. This includes the `typescript` package and `@angular` scoped packages, which account for a large number of large files that needs to be loaded from disk. This commit moves this work to the top-level, such that it doesn't have to be repeated in all tests. PR Close #38840
This commit is contained in:
parent
fd44d84a33
commit
a1c1c450dc
|
@ -213,13 +213,15 @@ export function compileIntoApf(
|
|||
fs.resolve(`/node_modules/${pkgName}/package.json`), JSON.stringify(pkgJson, null, 2));
|
||||
}
|
||||
|
||||
const stdFiles = loadStandardTestFiles({fakeCore: false});
|
||||
|
||||
/**
|
||||
* Prepares a mock filesystem that contains all provided source files, which can be used to emit
|
||||
* compiled code into.
|
||||
*/
|
||||
function setupCompileFs(sources: PackageSources): {rootNames: string[], compileFs: FileSystem} {
|
||||
const compileFs = new MockFileSystemPosix(true);
|
||||
compileFs.init(loadStandardTestFiles({fakeCore: false}));
|
||||
compileFs.init(stdFiles);
|
||||
|
||||
const rootNames = Object.keys(sources);
|
||||
|
||||
|
|
Loading…
Reference in New Issue