diff --git a/packages/nx/src/command-line/show/projects.spec.ts b/packages/nx/src/command-line/show/projects.spec.ts index b62d0d22e55e7f..fbc69a62dc6941 100644 --- a/packages/nx/src/command-line/show/projects.spec.ts +++ b/packages/nx/src/command-line/show/projects.spec.ts @@ -26,6 +26,7 @@ performance.measure = jest.fn(); describe('show projects', () => { beforeEach(() => { jest.spyOn(console, 'log').mockImplementation(() => {}); + performance.mark('init-local'); }); afterEach(() => { jest.clearAllMocks(); diff --git a/packages/nx/src/project-graph/affected/affected-project-graph.ts b/packages/nx/src/project-graph/affected/affected-project-graph.ts index 52cc5c8f0f2188..26cd04dd1a3441 100644 --- a/packages/nx/src/project-graph/affected/affected-project-graph.ts +++ b/packages/nx/src/project-graph/affected/affected-project-graph.ts @@ -30,6 +30,7 @@ export async function filterAffected( const touchedProjects = []; for (const locator of touchedProjectLocators) { + performance.mark(locator.name + ':start'); const projects = await locator( touchedFiles, graph.nodes, @@ -37,6 +38,12 @@ export async function filterAffected( packageJson, graph ); + performance.mark(locator.name + ':end'); + performance.measure( + locator.name, + locator.name + ':start', + locator.name + ':end' + ); touchedProjects.push(...projects); } diff --git a/packages/nx/src/project-graph/utils/retrieve-workspace-files.spec.ts b/packages/nx/src/project-graph/utils/retrieve-workspace-files.spec.ts index 4499637562e47b..b75b2142847302 100644 --- a/packages/nx/src/project-graph/utils/retrieve-workspace-files.spec.ts +++ b/packages/nx/src/project-graph/utils/retrieve-workspace-files.spec.ts @@ -27,12 +27,11 @@ describe('retrieveProjectConfigurationPaths', () => { const configPaths = await retrieveProjectConfigurationPaths(fs.tempDir, [ { + name: 'test', createNodes: [ '{project.json,**/project.json}', - () => { - return { - projects: {}, - }; + async () => { + return []; }, ], },