From 4a6f77694172ee11ae1e51bd14d8e335c900a2ce Mon Sep 17 00:00:00 2001 From: ylemkimon Date: Mon, 3 Aug 2020 13:05:17 +0900 Subject: [PATCH] test: mock console implementation (#2363) Co-authored-by: Kevin Barabash --- test/katex-spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/katex-spec.js b/test/katex-spec.js index f61709f3..cef40eee 100644 --- a/test/katex-spec.js +++ b/test/katex-spec.js @@ -3879,19 +3879,19 @@ describe("Extending katex by new fonts and symbols", function() { describe("debugging macros", () => { describe("message", () => { it("should print the argument using console.log", () => { - jest.spyOn(console, "log"); + jest.spyOn(console, "log").mockImplementation(); expect`\message{Hello, world}`.toParse(); // eslint-disable-next-line no-console - expect(console.log.mock.calls[0][0]).toEqual("Hello, world"); + expect(console.log).toHaveBeenCalledWith("Hello, world"); }); }); describe("errmessage", () => { it("should print the argument using console.error", () => { - jest.spyOn(console, "error"); + jest.spyOn(console, "error").mockImplementation(); expect`\errmessage{Hello, world}`.toParse(); // eslint-disable-next-line no-console - expect(console.error.mock.calls[0][0]).toEqual("Hello, world"); + expect(console.error).toHaveBeenCalledWith("Hello, world"); }); }); });