Skip to content

Commit 766a431

Browse files
committed
unit test
1 parent 68f2cb5 commit 766a431

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/aws-cdk-lib/core/test/annotations.test.ts

+18
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,22 @@ describe('annotations', () => {
129129
// THEN
130130
expect(getWarnings(app.synth())).toEqual([]);
131131
});
132+
133+
test('don\'t resolve the message if tokens are included', () => {
134+
// GIVEN
135+
const app = new App();
136+
const stack = new Stack(app, 'S1');
137+
const c1 = new Construct(stack, 'C1');
138+
139+
// WHEN
140+
Annotations.of(c1).addWarningV2('MESSAGE', `stackId: ${stack.stackId}`);
141+
142+
// THEN
143+
expect(getWarnings(app.synth())).toEqual([
144+
{
145+
path: '/S1/C1',
146+
message: expect.stringMatching(/stackId: \${Token\[AWS::StackId\.\d+\]} \[ack: MESSAGE\]/),
147+
},
148+
]);
149+
});
132150
});

0 commit comments

Comments
 (0)