mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 11:48:41 +00:00
Add \message, \errmessage, and \show for debugging (#2135)
* Add \message, \errmessage, and \show for debugging * Remove unnecessary parentheses * add tests for \message and \errmessage
This commit is contained in:
committed by
Kevin Barabash
parent
e5333ad04d
commit
0d8830af30
@@ -3732,3 +3732,23 @@ describe("Extending katex by new fonts and symbols", function() {
|
||||
expect(katex.renderToString("۹۹^{۱۱}")).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("debugging macros", () => {
|
||||
describe("message", () => {
|
||||
it("should print the argument using console.log", () => {
|
||||
jest.spyOn(console, "log");
|
||||
expect`\message{Hello, world}`.toParse();
|
||||
// eslint-disable-next-line no-console
|
||||
expect(console.log.mock.calls[0][0]).toEqual("Hello, world");
|
||||
});
|
||||
});
|
||||
|
||||
describe("errmessage", () => {
|
||||
it("should print the argument using console.error", () => {
|
||||
jest.spyOn(console, "error");
|
||||
expect`\errmessage{Hello, world}`.toParse();
|
||||
// eslint-disable-next-line no-console
|
||||
expect(console.error.mock.calls[0][0]).toEqual("Hello, world");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user