Skip to content

Commit

Permalink
add a cli-integ test
Browse files Browse the repository at this point in the history
  • Loading branch information
go-to-k committed Dec 23, 2024
1 parent 346169b commit ebd9671
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
withSamIntegrationFixture,
withSpecificFixture,
} from '../../lib';
import { options } from 'yargs';

jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime

Expand Down Expand Up @@ -2582,6 +2583,13 @@ integTest('cdk destroy does not fail even if the stacks do not exist', withDefau
await expect(fixture.cdkDestroy([nonExistingStackName1, nonExistingStackName2])).resolves.not.toThrow();
}));

integTest('cdk destroy with no force option exits without prompt if the stacks do not exist', withDefaultFixture(async (fixture) => {
const nonExistingStackName1 = 'non-existing-stack-1';
const nonExistingStackName2 = 'non-existing-stack-2';

await expect(fixture.cdk(['destroy', ...fixture.fullStackName([nonExistingStackName1, nonExistingStackName2])])).resolves.not.toThrow();
}));

async function listChildren(parent: string, pred: (x: string) => Promise<boolean>) {
const ret = new Array<string>();
for (const child of await fs.readdir(parent, { encoding: 'utf-8' })) {
Expand Down

0 comments on commit ebd9671

Please sign in to comment.