Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
comcalvi committed Jan 19, 2024
1 parent 7c42e40 commit 9742df6
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions packages/aws-cdk/test/diff.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,30 @@ let cloudExecutable: MockCloudExecutable;
let cloudFormation: jest.Mocked<Deployments>;
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(),
Expand All @@ -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',
},
},
},
Expand Down Expand Up @@ -70,7 +87,7 @@ describe('imports', () => {
}));
});

test('cringeAF', async () => {
test('imports', async () => {
// GIVEN
const buffer = new StringWritable();

Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 9742df6

Please sign in to comment.