From 9742df64a1ba7866de67242650adf74931c50502 Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Fri, 19 Jan 2024 13:49:13 -0800 Subject: [PATCH] rename --- packages/aws-cdk/test/diff.test.ts | 38 ++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/packages/aws-cdk/test/diff.test.ts b/packages/aws-cdk/test/diff.test.ts index b188bf68dc279..b611912df3048 100644 --- a/packages/aws-cdk/test/diff.test.ts +++ b/packages/aws-cdk/test/diff.test.ts @@ -12,16 +12,30 @@ let cloudExecutable: MockCloudExecutable; let cloudFormation: jest.Mocked; let toolkit: CdkToolkit; -jest.mock('../lib/api/util/cloudformation', () => { +const cfnMock = jest.mock('../lib/api/util/cloudformation', () => { return { createDiffChangeSet: jest.fn(() => { return { - Changes: [{ - ResourceChange: { - Action: 'Import', - LogicalResourceId: 'Queue', + Changes: [ + { + ResourceChange: { + Action: 'Import', + LogicalResourceId: 'Queue', + }, + }, + { + ResourceChange: { + Action: 'Import', + LogicalResourceId: 'Bucket', + }, + }, + { + ResourceChange: { + Action: 'Import', + LogicalResourceId: 'Queue2', + }, }, - }], + ], }; }), waitForChangeSet: jest.fn(), @@ -37,9 +51,12 @@ describe('imports', () => { Resources: { Queue: { Type: 'AWS::SQS::Queue', - Properties: { - foo: 'bar', - }, + }, + Queue2: { + Type: 'AWS::SQS::Queue', + }, + Bucket: { + Type: 'AWS::SQS::Queue', }, }, }, @@ -70,7 +87,7 @@ describe('imports', () => { })); }); - test('cringeAF', async () => { + test('imports', async () => { // GIVEN const buffer = new StringWritable(); @@ -417,6 +434,7 @@ Resources test('diff falls back to non-changeset diff for nested stacks', async () => { // GIVEN + cfnMock.restoreAllMocks(); const changeSetSpy = jest.spyOn(cfn, 'waitForChangeSet'); const buffer = new StringWritable();