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

Typechecked should be a boolean #532

Merged
merged 7 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/commands/database/create.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function buildCreateCommand(yargs) {
description: "Name of the child database to create.",
},
typechecked: {
type: "string",
type: "boolean",
description:
"Enable typechecking for the database. Defaults to the typechecking setting of the parent database.",
},
Expand Down
23 changes: 23 additions & 0 deletions test/database/create.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,29 @@ describe("database create", () => {
});
});

[
{
flag: "--typechecked",
value: "imastring",
},
{
flag: "--protected",
value: "imastring",
},
].forEach(({ flag, value }) => {
it(`handles invalid option types: ${flag} ${value}`, async () => {
try {
await run(
`database create --name 'testdb' --secret 'secret' ${flag} ${value}`,
container,
);
} catch (e) {}
// Make sure we bail before calling fauna
expect(runQuery).to.not.have.been.called;
expect(logger.stderr).to.have.been.called;
});
});

[
{
error: new ServiceError({
Expand Down
Loading