I am trying to run a bunch of test cases and this particular one fails but the expected output is the same as the received output except the "·" after every line. Why "·" shows up after every line in testing even though when I run the program it doesn't. I have attached the output below.
Error after running the test case
Expected: StringContaining "[3] find needle in the haystack
[2] water the plants
[1] the thing i need to do
"
Received: "[3] find needle in the haystack·
[2] water the plants·
[1] the thing i need to do·
"
Test case code:
test("list todos in reverse order (added latest first)", () => {
let todos = [
"the thing i need to do",
"water the plants",
"find needle in the haystack",
];
todos.forEach((todo) => execSync(todoTxtCli("add", `"${todo}"`)));
let expected = `[3] find needle in the haystack
[2] water the plants
[1] the thing i need to do
`;
let received = execSync(todoTxtCli("ls")).toString("utf8");
expect(received).toEqual(expect.stringContaining(expected));
});
Aucun commentaire:
Enregistrer un commentaire