mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 03:38:39 +00:00
Test for duplicate symbols/macros (#1955)
* 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
This commit is contained in:
committed by
Kevin Barabash
parent
664dc6ab74
commit
5aad8f9f32
22
test/dup-spec.js
Normal file
22
test/dup-spec.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/* 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();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user