mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 11:48:41 +00:00
* Test for duplicate symbols/macros We've had a few cases where we accidentally include the same symbol or macro definition in both macros.js and symbols.js. This new test automatically detects these scenarios during Jest testing. * Fix lint errors
23 lines
612 B
JavaScript
23 lines
612 B
JavaScript
/* global expect: false */
|
|
/* global it: false */
|
|
/* global describe: false */
|
|
|
|
import symbols from '../src/symbols.js';
|
|
import macros from '../src/macros.js';
|
|
|
|
describe("Symbols and macros", () => {
|
|
for (const macro in macros) {
|
|
if (!macros.hasOwnProperty(macro)) {
|
|
continue;
|
|
}
|
|
it(`macro ${macro} should not shadow a symbol`, () => {
|
|
for (const kind in symbols) {
|
|
if (!symbols.hasOwnProperty(kind)) {
|
|
continue;
|
|
}
|
|
expect(symbols[kind][macro]).toBeFalsy();
|
|
}
|
|
});
|
|
}
|
|
});
|