Skip to content

Commit 78e191d

Browse files
committed
unit tests
1 parent a3fde3b commit 78e191d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Diff for: packages/aws-cdk/test/cdk-toolkit.test.ts

+26
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,32 @@ describe('destroy', () => {
945945
});
946946
}).resolves;
947947
});
948+
949+
test('does not throw even if there is a non-existent stack and the other exists', async () => {
950+
const toolkit = defaultToolkitSetup();
951+
952+
await expect(() => {
953+
return toolkit.destroy({
954+
selector: { patterns: ['Test-Stack-X', 'Test-Stack-A/Test-Stack-C'] },
955+
exclusively: true,
956+
force: true,
957+
fromDeploy: true,
958+
});
959+
}).resolves;
960+
});
961+
962+
test('does not throw even if there are only non-existent stacks', async () => {
963+
const toolkit = defaultToolkitSetup();
964+
965+
await expect(() => {
966+
return toolkit.destroy({
967+
selector: { patterns: ['Test-Stack-X', 'Test-Stack-Y'] },
968+
exclusively: true,
969+
force: true,
970+
fromDeploy: true,
971+
});
972+
}).resolves;
973+
});
948974
});
949975

950976
describe('watch', () => {

0 commit comments

Comments
 (0)