Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
go-to-k committed Nov 5, 2024
1 parent 5c6cc5e commit 22dc6f3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/aws-cdk-lib/assertions/test/template.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,27 @@ describe('Template', () => {
}).toThrow(/dependency cycle/);
});

test('throws when given a template with cyclic dependencies if a skip flag is false', () => {
expect(() => {
Template.fromJSON({
Resources: {
Res1: {
Type: 'Foo',
Properties: {
Thing: { Ref: 'Res2' },
},
},
Res2: {
Type: 'Foo',
DependsOn: ['Res1'],
},
},
}, {
skipCyclicalDependenciesCheck: false,
});
}).toThrow(/dependency cycle/);
});

test('does not throw when given a template with cyclic dependencies if check is skipped', () => {
expect(() => {
Template.fromJSON({
Expand Down

0 comments on commit 22dc6f3

Please sign in to comment.