refactor(ngcc): simplify DirectoryWalkerEntryPointFinder (#36305)

This commit simplifies the `DirectoryWalkerEntryPointFinder` inter-method
calling to make it easier to follow, and also to support controlling
walking of a directory based on its children.

PR Close #36305
This commit is contained in:
Pete Bacon Darwin
2020-03-29 17:13:43 +01:00
committed by Alex Rickabaugh
parent de594ca221
commit 29dcb5bf68
3 changed files with 125 additions and 106 deletions

View File

@ -230,7 +230,7 @@ runInEachFileSystem(() => {
const finder = new DirectoryWalkerEntryPointFinder(
fs, config, logger, resolver, manifest, _Abs('/nested_node_modules/node_modules'),
undefined);
const spy = spyOn(finder, 'walkDirectoryForEntryPoints').and.callThrough();
const spy = spyOn(finder, 'walkDirectoryForPackages').and.callThrough();
const {entryPoints} = finder.findEntryPoints();
expect(spy.calls.allArgs()).toEqual([
[_Abs(basePath)],
@ -252,7 +252,7 @@ runInEachFileSystem(() => {
const finder = new DirectoryWalkerEntryPointFinder(
fs, config, logger, resolver, manifest, basePath, undefined);
const spy = spyOn(finder, 'walkDirectoryForEntryPoints').and.callThrough();
const spy = spyOn(finder, 'walkDirectoryForPackages').and.callThrough();
const {entryPoints} = finder.findEntryPoints();
expect(spy.calls.allArgs()).toEqual([
[_Abs(basePath)],
@ -276,7 +276,7 @@ runInEachFileSystem(() => {
const finder = new DirectoryWalkerEntryPointFinder(
fs, config, logger, resolver, manifest, basePath, undefined);
const spy = spyOn(finder, 'walkDirectoryForEntryPoints').and.callThrough();
const spy = spyOn(finder, 'walkDirectoryForPackages').and.callThrough();
const {entryPoints} = finder.findEntryPoints();
expect(spy.calls.allArgs()).toEqual([
[_Abs(basePath)],