I have a file fele.js that specifies all commands that my app needs.
Command Used - Just says hello world when hello is entered.
const program = new commander.Command();
const helloCommand = program.command('hello');
helloCommand
.action(async(options) => {
console.log("Hello World"); //Works well as
return "Hello World";//But this does not work.
})
Now I am using Mocha to test the command. PFB Code
Please do suggest me an approach with which I can be able to get not only by using console.log but also by using return statement. Like process.stdout.on works for console.log statements, suggest me some thing that works for a process's method return value.
I have a file fele.js that specifies all commands that my app needs.
Command Used - Just says hello world when hello is entered.
Now I am using Mocha to test the command. PFB Code
Please do suggest me an approach with which I can be able to get not only by using console.log but also by using return statement. Like process.stdout.on works for console.log statements, suggest me some thing that works for a process's method return value.