From 0d630606833dc43a3cb31d4fafacbb2e99d6d8a7 Mon Sep 17 00:00:00 2001 From: Steve Hetzel Date: Fri, 13 Sep 2024 13:23:19 -0600 Subject: [PATCH] fix: correc the tests --- .../destructiveCompSets/snapshots.test.ts | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/test/snapshot/sampleProjects/destructiveCompSets/snapshots.test.ts b/test/snapshot/sampleProjects/destructiveCompSets/snapshots.test.ts index 0df5bf612..0a994710f 100644 --- a/test/snapshot/sampleProjects/destructiveCompSets/snapshots.test.ts +++ b/test/snapshot/sampleProjects/destructiveCompSets/snapshots.test.ts @@ -57,7 +57,13 @@ describe('Creating and converting ComponentSets with destructive changes', () => for (const file of convertedFiles) { await fileSnap(file, testDir); } - await dirsAreIdentical(path.join(snapshotsDir, 'testOutput', 'pre1'), pre1TestOutputDir); + const expectedOutputDir = path.join( + snapshotsDir, + '1-pre-destructive-and-1-deployment.expected', + 'testOutput', + 'pre1' + ); + await dirsAreIdentical(expectedOutputDir, pre1TestOutputDir); }); it('2 pre-destructive and 2 deployments', async () => { @@ -82,7 +88,13 @@ describe('Creating and converting ComponentSets with destructive changes', () => for (const file of convertedFiles) { await fileSnap(file, testDir); } - await dirsAreIdentical(path.join(snapshotsDir, 'testOutput', 'pre2'), pre2TestOutputDir); + const expectedOutputDir = path.join( + snapshotsDir, + '2-pre-destructive-and-2-deployments.expected', + 'testOutput', + 'pre2' + ); + await dirsAreIdentical(expectedOutputDir, pre2TestOutputDir); }); it('1 post-destructive and 1 deployment', async () => { @@ -107,7 +119,13 @@ describe('Creating and converting ComponentSets with destructive changes', () => for (const file of convertedFiles) { await fileSnap(file, testDir); } - await dirsAreIdentical(path.join(snapshotsDir, 'testOutput', 'post1'), postTestOutputDir); + const expectedOutputDir = path.join( + snapshotsDir, + '1-post-destructive-and-1-deployment.expected', + 'testOutput', + 'post1' + ); + await dirsAreIdentical(expectedOutputDir, postTestOutputDir); }); it('2 post-destructive and 2 deployments', async () => { @@ -132,7 +150,13 @@ describe('Creating and converting ComponentSets with destructive changes', () => for (const file of convertedFiles) { await fileSnap(file, testDir); } - await dirsAreIdentical(path.join(snapshotsDir, 'testOutput', 'post2'), post2TestOutputDir); + const expectedOutputDir = path.join( + snapshotsDir, + '2-post-destructive-and-2-deployments.expected', + 'testOutput', + 'post2' + ); + await dirsAreIdentical(expectedOutputDir, post2TestOutputDir); }); it('1 post-destructive and no deployment', async () => { @@ -157,7 +181,13 @@ describe('Creating and converting ComponentSets with destructive changes', () => for (const file of convertedFiles) { await fileSnap(file, testDir); } - await dirsAreIdentical(path.join(snapshotsDir, 'testOutput', 'post1-solo'), postTestOutputDir); + const expectedOutputDir = path.join( + snapshotsDir, + '1-post-destructive-and-no-deployment.expected', + 'testOutput', + 'post1-solo' + ); + await dirsAreIdentical(expectedOutputDir, postTestOutputDir); }); it('throws when wildcards are used in destructive changes', async () => {