Files
KaTeX/test/dup-spec.js
Erik Demaine 5aad8f9f32 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
2019-04-28 19:52:39 -04:00

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();
}
});
}
});