Created
January 30, 2023 05:10
-
-
Save rahulbanerjee26/723ccee3bcfda9bccf6f673ee872f21e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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