Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
rix0rrr committed Oct 24, 2024
1 parent 6523cc0 commit af27bf6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/aws-cdk/test/api/util/checks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ describe('determineAllowCrossAccountAssetPublishing', () => {
expect(result).toBe(true);
});

it('should return true if looking up the bootstrap stack fails', async () => {
AWSMock.mock('CloudFormation', 'describeStacks', (_params: any, callback: Function) => {
callback(new Error('Could not read bootstrap stack'));
});

const result = await determineAllowCrossAccountAssetPublishing(mockSDK);
expect(result).toBe(true);
});

it('should return false for other scenarios', async () => {
AWSMock.mock('CloudFormation', 'describeStacks', (_params: any, callback: Function) => {
callback(null, {
Expand Down

0 comments on commit af27bf6

Please sign in to comment.