Closed zorkow closed 4 months ago
Changed everything to work with mjs
files now, including importing modules via #js/
paths, and without .js
extensions, as this is not necessary.
@dpvc PTAL.
I've made a PR to this branch that moves the testing into a separate subdirectory. See what you think of that, otherwise, we can go with this as is.
Refactors the tests directory and parts of the old tests repository.
package.json
file, it has the advantage thatjest
can produce coverage information for our functions.ts
source directory. Why roughly?src
directory containing some auxiliary functionality for tests.Ams.test.ts
should cover the entire package.Tag.test.ts
file that tests different tag settings.commonjs
modules, which has a couple of consequences:cjs
. An exception is for exampletests/input/tex/UnitUtil.test.ts
where we can directly import thets
file, without extension. Once we move toesnext
as our typescript target we can use that everywhere, withNODE_OPTIONS=--experimental-vm-modules
switch.package.json
into thecjs
directory to redirect all the external library paths to theircommonjs
targets. (@dpvc I am wondering if we should not have that file in thecjs
directory by default.)Usage
pnpm test
orpnpm jest Path-to-test
.pnpm test &> /tmp/test-output
or similar.Current State
lengths
andUnitUtil
.received
toexpected
by producing MathML output.SerializedMmlVisitor
.expect
method (getting around some type issues) that does a deep comparison usingxml2json
functionality from thexml-js
package.Things left to do
KeyvalTest, ParserConfigMacros
..test.ts
file.jest-diff-test
for Emacs in theMathJax-tests
repository to work with the current tests