Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cli): prevent test interference #32270

Merged
merged 10 commits into from
Nov 25, 2024
Prev Previous commit
Next Next commit
Add tests
  • Loading branch information
rix0rrr committed Nov 25, 2024
commit 910505a35e29a55746ec2efe6df60d633b1a7877
11 changes: 9 additions & 2 deletions packages/aws-cdk/test/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ describe('constructs version', () => {
expect(await fs.pathExists(path.join(workDir, 'lib'))).toBeTruthy();
});

cliTest('asking for a nonexistent combination of language and template fails', async (workDir) => {
cliTest('asking for a nonexistent template fails', async (workDir) => {
await expect(cliInit({
type: 'banana',
language: 'typescript',
workDir,
})).rejects.toThrow(/is not supported/);
})).rejects.toThrow(/Unknown init template/);
});

cliTest('asking for a template but no language prints and throws', async (workDir) => {
await expect(cliInit({
type: 'app',
workDir,
})).rejects.toThrow(/No language/);
});

cliTest('create a TypeScript app project', async (workDir) => {
Expand Down
Loading