https://github.com/mathjax/mathjax-tests
Tests Repository for MathJax
https://github.com/mathjax/mathjax-tests
Last synced: 3 months ago
JSON representation
Tests Repository for MathJax
- Host: GitHub
- URL: https://github.com/mathjax/mathjax-tests
- Owner: mathjax
- License: apache-2.0
- Created: 2020-11-02T11:13:39.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-07-17T15:06:40.000Z (almost 3 years ago)
- Last Synced: 2025-01-18T02:27:43.456Z (over 1 year ago)
- Language: JavaScript
- Size: 528 KB
- Stars: 0
- Watchers: 6
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MathJax Tests
__Tests Repository for MathJax version 3.0 and above.__
## Tests
We use [Jest](https://jestjs.io) as test framework.
### Running Tests
Just go to the root of this repository and run the following two commands:
``` shell
npm install
npm test
```
TeX parser tests in particular are run with the command:
``` shell
npx jest src/parser.test.js
```
To only test a single file run
``` shell
npx jest src/parser.test.js json/FILE.json
```
Tests initially run against `mathjax-full` package. They can be run against your
local repository by rerouting the `js` and `es5` directories.
### Test Format
Tests are provided in a JSON test format.
``` json
{
"name": NameOfTest,
"factory": TestFactory,
"tests": {
"TEST1": {
"input": INPUT
"expected": EXPECTED
...rest
}
...more tests
}
}
```
To add new tests, simply add a new `.json` file in the `json` sub-directory. For
new test classes add a new entry in `src/test-factory.js`.