You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
async function setupSMPT() {
let smtpUsername = "NA";
let smtpPassword = "NA";
const confirm = await Confirm.prompt(
"Do you want to setup a connection with a SMTP server?",
);
if (confirm) {
smtpUsername = await Input.prompt(
"Please specify the username to connect to your SMTP server:",
);
smtpPassword = await Input.prompt(
"Please specify the password to connect to your SMTP server:",
);
}
return { smtpUsername, smtpPassword };
}
const smtp = new Command()
.name("smtp")
.option(
"--interactive [interactive:boolean]",
"Enable or disable interactive mode.",
{ default: true },
)
.action(setupSMPT)
await new Command()
.name("root")
.command("smtp", smtp)
.parse(Deno.args);
How can I test it? Basically, it's 2 sub-tasks I need to do:
Provide a stub for promps used in the action function. Is there a helper for this?
Run the command either as a subprocess with Deno.run/spawnChild or directly calling an action function setupSMPT({...})
Any help is appreciated!
The text was updated successfully, but these errors were encountered:
Let's say I have this very basic command:
How can I test it? Basically, it's 2 sub-tasks I need to do:
Deno.run/spawnChild
or directly calling an action functionsetupSMPT({...})
Any help is appreciated!
The text was updated successfully, but these errors were encountered: