Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
builder(argv) {
/* istanbul ignore next */
return generateBuilder(argv)
.option("output", {
type: "string",
describe: "Output format",
default: PrintFormat.YAML,
choices: Object.keys(PrintFormat).map(key => (PrintFormat as any)[key]),
alias: "o"
})
.option("validate", {
type: "boolean",
describe: "Validate components",
default: true
})
.example("$0 generate", "Generate manifests")
.example("$0 generate foo bar", "Specify components")
.example("$0 generate foo_*", "Use glob pattern")
.example("$0 generate --env foo", "Set environment")
.example("$0 generate -r ts-node/register", "Require external modules");
},
async handler(args) {
test("should call print with given format", () => {
expect(print).toHaveBeenCalledWith(result, {
format: PrintFormat.YAML,
writer: process.stdout
});
});
});
beforeAll(() => {
args.output = PrintFormat.YAML;
});