From d5bdaa668541f0a0a6e765cbf5e32b11a48037a3 Mon Sep 17 00:00:00 2001 From: khalilou88 Date: Sat, 30 Sep 2023 15:20:02 +0200 Subject: [PATCH] test: work in progress --- .../tests/nx-boot-gradle.spec.ts | 20 +++++++++++-------- .../tests/nx-boot-maven.spec.ts | 20 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/testing-projects/smoke-affected/nx-boot-gradle-smoke-affected/tests/nx-boot-gradle.spec.ts b/testing-projects/smoke-affected/nx-boot-gradle-smoke-affected/tests/nx-boot-gradle.spec.ts index aab9e095b..445222609 100644 --- a/testing-projects/smoke-affected/nx-boot-gradle-smoke-affected/tests/nx-boot-gradle.spec.ts +++ b/testing-projects/smoke-affected/nx-boot-gradle-smoke-affected/tests/nx-boot-gradle.spec.ts @@ -108,15 +108,19 @@ describe('@jnxplus/nx-gradle spring-boot smoke', () => { execSync(`git commit -am "chore: scaffold projects"`, execSyncOptions()); - const affected = execSync( - 'npx nx show projects --affected', + execSync( + `npx nx graph --affected --file=dep-graph-affected.json`, execSyncOptions(), ); - expect(affected).not.toContain(testApp); - expect(affected).not.toContain(testApp2); - expect(affected).not.toContain(testApp3); - expect(affected).not.toContain(testApp4); - expect(affected).not.toContain(testLib); - expect(affected).not.toContain(testLib2); + + const depGraphAffectedJson = await readJson( + join(smokeDirectory, 'test', 'dep-graph-affected.json'), + ); + expect(depGraphAffectedJson.graph.nodes[testApp]).toBeDefined(); + expect(depGraphAffectedJson.graph.nodes[testApp2]).toBeDefined(); + expect(depGraphAffectedJson.graph.nodes[testApp3]).toBeDefined(); + expect(depGraphAffectedJson.graph.nodes[testApp4]).toBeDefined(); + expect(depGraphAffectedJson.graph.nodes[testLib]).toBeDefined(); + expect(depGraphAffectedJson.graph.nodes[testLib2]).toBeDefined(); }, 1500000); }); diff --git a/testing-projects/smoke-affected/nx-boot-maven-smoke-affected/tests/nx-boot-maven.spec.ts b/testing-projects/smoke-affected/nx-boot-maven-smoke-affected/tests/nx-boot-maven.spec.ts index 198bc84c5..bd99e60e8 100644 --- a/testing-projects/smoke-affected/nx-boot-maven-smoke-affected/tests/nx-boot-maven.spec.ts +++ b/testing-projects/smoke-affected/nx-boot-maven-smoke-affected/tests/nx-boot-maven.spec.ts @@ -110,15 +110,19 @@ describe('@jnxplus/nx-maven spring-boot smoke', () => { execSync(`git commit -am "chore: scaffold projects"`, execSyncOptions()); - const affected = execSync( - 'npx nx show projects --affected', + execSync( + `npx nx graph --affected --file=dep-graph-affected.json`, execSyncOptions(), ); - expect(affected).not.toContain(testApp); - expect(affected).not.toContain(testApp2); - expect(affected).not.toContain(testApp3); - expect(affected).not.toContain(testApp4); - expect(affected).not.toContain(testLib); - expect(affected).not.toContain(testLib2); + + const depGraphAffectedJson = await readJson( + join(smokeDirectory, 'test', 'dep-graph-affected.json'), + ); + expect(depGraphAffectedJson.graph.nodes[testApp]).toBeDefined(); + expect(depGraphAffectedJson.graph.nodes[testApp2]).toBeDefined(); + expect(depGraphAffectedJson.graph.nodes[testApp3]).toBeDefined(); + expect(depGraphAffectedJson.graph.nodes[testApp4]).toBeDefined(); + expect(depGraphAffectedJson.graph.nodes[testLib]).toBeDefined(); + expect(depGraphAffectedJson.graph.nodes[testLib2]).toBeDefined(); }, 1500000); });