Skip to content

Commit

Permalink
chore(core): more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Dec 3, 2024
1 parent b291fac commit 8ddbc07
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
9 changes: 4 additions & 5 deletions packages/nx/src/command-line/run-many/run-many.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ describe('run-many', () => {
}
});

it('should be able to select and exclude via patterns', async () => {
performance.mark('start');
it('should be able to select and exclude via patterns', () => {
const start = performance.now();
projectsToRun(
{
targets: ['test'],
Expand All @@ -199,9 +199,8 @@ describe('run-many', () => {
},
projectGraph
);
performance.mark('end');
const measure = performance.measure('projects', 'start', 'end');
expect(measure.duration).toBeLessThan(10000);
const end = performance.now();
expect(end - start).toBeLessThan(10000);
});
});
});
Expand Down
1 change: 1 addition & 0 deletions packages/nx/src/command-line/show/projects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ performance.measure = jest.fn();
describe('show projects', () => {
beforeEach(() => {
jest.spyOn(console, 'log').mockImplementation(() => {});
performance.mark('init-local');
});
afterEach(() => {
jest.clearAllMocks();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,20 @@ export async function filterAffected(

const touchedProjects = [];
for (const locator of touchedProjectLocators) {
performance.mark(locator.name + ':start');
const projects = await locator(
touchedFiles,
graph.nodes,
nxJson,
packageJson,
graph
);
performance.mark(locator.name + ':end');
performance.measure(
locator.name,
locator.name + ':start',
locator.name + ':end'
);
touchedProjects.push(...projects);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ describe('retrieveProjectConfigurationPaths', () => {

const configPaths = await retrieveProjectConfigurationPaths(fs.tempDir, [
{
name: 'test',
createNodes: [
'{project.json,**/project.json}',
() => {
return {
projects: {},
};
async () => {
return [];
},
],
},
Expand Down

0 comments on commit 8ddbc07

Please sign in to comment.