MathJax-src
MathJax-src copied to clipboard
Jest custom reporter for macro coverage of tex package
Title says it all. A custom reporter that outputs the coverage of how many macros per TeX package are tested.
Since we cannot store information globally and pass them to the reporter (Some discussions on this are here: https://github.com/jestjs/jest/issues/7421) I have employed a hack outputting JSON to the FS, currently a file /tmp/test.json.
Then we output one table per TeX package, not has nicely coloured as the general coverage table.
This is a mix of .js, .ts.d and .ts files, as I could not get the reporter to run as .ts file, since we do not compile our test sources.
I am sure it could be done better, but I think spending two says on this is sufficient, as all we really want it for is to get to 100% coverage for our macros.
since we do not compile our test sources.
Actually, they should be compiled into the js directory when you edit them in emacs, and you could do a tsc command in the test suite directory if you wanted to, and if that helps. But not really necessary since you have it working, just if it made things cleaner.
Changes made. PTAL.
Took care of the two missing comments and merged.