Skip to content

Commit 284f755

Browse files
committed
test(plugin-eslint): fix project graph errors in nx integration test
1 parent 31bed82 commit 284f755

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/cli/project.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "cli",
33
"sourceRoot": "packages/cli/src",
44
"projectType": "application",
5-
"implicitDependencies": ["core"],
65
"targets": {
76
"lint": {
87
"executor": "@nx/eslint:lint"

packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/core/project.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "core",
33
"sourceRoot": "packages/core/src",
44
"projectType": "library",
5-
"implicitDependencies": ["utils"],
65
"targets": {
76
"lint": {
87
"executor": "@nx/eslint:lint"

packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/nx-plugin/project.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "nx-plugin",
33
"sourceRoot": "packages/nx-plugin/src",
44
"projectType": "library",
5-
"implicitDependencies": ["utils"],
65
"targets": {
76
"lint": {
87
"executor": "@nx/eslint:lint"

packages/plugin-eslint/src/lib/nx.integration.test.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import path from 'node:path';
22
import { fileURLToPath } from 'node:url';
33
import type { MockInstance } from 'vitest';
4+
import { executeProcess } from '@code-pushup/utils';
45
import type { ESLintTarget } from './config.js';
56
import { eslintConfigFromNxProject } from './nx/find-project-without-deps.js';
67
import {
@@ -13,7 +14,7 @@ type Project = 'cli' | 'core' | 'nx-plugin' | 'utils';
1314
describe('Nx helpers', () => {
1415
let cwdSpy: MockInstance<[], string>;
1516

16-
beforeAll(() => {
17+
beforeAll(async () => {
1718
const workspaceDir = path.join(
1819
fileURLToPath(path.dirname(import.meta.url)),
1920
'..',
@@ -23,6 +24,12 @@ describe('Nx helpers', () => {
2324
'nx-monorepo',
2425
);
2526
cwdSpy = vi.spyOn(process, 'cwd').mockReturnValue(workspaceDir);
27+
28+
// HACK: somehow prevents "Failed to process project graph" errors
29+
await executeProcess({
30+
command: 'npx nx graph --file=.nx/graph.json',
31+
cwd: workspaceDir,
32+
});
2633
});
2734

2835
afterAll(() => {

0 commit comments

Comments
 (0)