Skip to content

Instantly share code, notes, and snippets.

@rahulbanerjee26
Created January 30, 2023 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulbanerjee26/723ccee3bcfda9bccf6f673ee872f21e to your computer and use it in GitHub Desktop.
Save rahulbanerjee26/723ccee3bcfda9bccf6f673ee872f21e to your computer and use it in GitHub Desktop.
test("should print hello world", () => {
// Run the hello command and capture the output
const output = childProcess.execSync(`tcli hello`, {
encoding: "utf8",
});
// Check that the output is correct
expect(output).to.equal("Hello, World!\n");
});
test("should print a greeting", () => {
// Run the hello command and capture the output
const output = childProcess.execSync(`tcli Hello Rahul`, {
encoding: "utf8",
});
// Check that the output is correct
expect(output).to.equal("Hello, Rahul!\n");
});
test("should perform the specified operation", () => {
// Run the calculate command and capture the output
const output = childProcess.execSync(`tcli calculate 3 4 -o multiply`, {
encoding: "utf8",
});
// Check that the output is correct
expect(output).to.equal("12\n");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment