Skip to content

Commit

Permalink
fix(core): fix a flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Nov 23, 2023
1 parent 6630658 commit cee187b
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions packages/nx/src/command-line/run-many/run-many.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { projectsToRun } from './run-many';
import { performance } from 'perf_hooks';
import { ProjectGraph } from '../../config/project-graph';
import {projectsToRun} from './run-many';
import {performance} from 'perf_hooks';
import {ProjectGraph} from '../../config/project-graph';

describe('run-many', () => {
describe('projectsToRun', () => {
Expand Down Expand Up @@ -44,7 +44,7 @@ describe('run-many', () => {
projects: [],
},
projectGraph
).map(({ name }) => name);
).map(({name}) => name);
expect(projects).toContain('proj1');
expect(projects).toContain('proj2');
});
Expand All @@ -56,7 +56,7 @@ describe('run-many', () => {
projects: ['proj1'],
},
projectGraph
).map(({ name }) => name);
).map(({name}) => name);
expect(projects).toContain('proj1');
expect(projects).not.toContain('proj2');
});
Expand All @@ -68,7 +68,7 @@ describe('run-many', () => {
projects: ['proj*'],
},
projectGraph
).map(({ name }) => name);
).map(({name}) => name);
expect(projects).toContain('proj1');
expect(projects).toContain('proj2');
});
Expand All @@ -80,7 +80,7 @@ describe('run-many', () => {
projects: ['tag:api'],
},
projectGraph
).map(({ name }) => name);
).map(({name}) => name);
expect(projects).toContain('proj1');
expect(projects).not.toContain('proj2');
});
Expand All @@ -92,7 +92,7 @@ describe('run-many', () => {
projects: ['tag:theme*'],
},
projectGraph
).map(({ name }) => name);
).map(({name}) => name);
expect(projects).toContain('proj1');
expect(projects).toContain('proj2');
});
Expand All @@ -104,7 +104,7 @@ describe('run-many', () => {
projects: ['proj1', 'tag:ui'],
},
projectGraph
).map(({ name }) => name);
).map(({name}) => name);
expect(projects).toContain('proj1');
expect(projects).toContain('proj2');
projects = projectsToRun(
Expand All @@ -113,7 +113,7 @@ describe('run-many', () => {
projects: ['proj1', 'tag:a*'],
},
projectGraph
).map(({ name }) => name);
).map(({name}) => name);
expect(projects).toContain('proj1');
});

Expand All @@ -126,7 +126,7 @@ describe('run-many', () => {
exclude: ['proj1'],
},
projectGraph
).map(({ name }) => name);
).map(({name}) => name);
expect(projects).not.toContain('proj1');
expect(projects).toContain('proj2');
});
Expand All @@ -140,7 +140,7 @@ describe('run-many', () => {
exclude: ['proj*'],
},
projectGraph
).map(({ name }) => name);
).map(({name}) => name);
expect(projects).not.toContain('proj1');
expect(projects).not.toContain('proj2');
});
Expand All @@ -154,7 +154,7 @@ describe('run-many', () => {
exclude: ['tag:ui'],
},
projectGraph
).map(({ name }) => name);
).map(({name}) => name);
expect(projects).toContain('proj1');
expect(projects).not.toContain('proj2');
});
Expand All @@ -168,7 +168,7 @@ describe('run-many', () => {
exclude: ['tag:theme*'],
},
projectGraph
).map(({ name }) => name);
).map(({name}) => name);
expect(projects).not.toContain('proj1');
expect(projects).not.toContain('proj2');
});
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('run-many', () => {
);
performance.mark('end');
const measure = performance.measure('projects', 'start', 'end');
expect(measure.duration).toBeLessThan(4000);
expect(measure.duration).toBeLessThan(10000);
});
});
});
Expand Down

0 comments on commit cee187b

Please sign in to comment.