docs: document how to run tests for the type definitions

This commit is contained in:
Jos de Jong 2024-05-16 08:46:58 +02:00
parent 599f4ee804
commit 49df88985e
2 changed files with 17 additions and 1 deletions

View File

@ -160,6 +160,10 @@ Then, the tests can be executed:
npm test
To test the type definitions:
npm run test:types
Additionally, the tests can be run on FireFox using [headless mode](https://developer.mozilla.org/en-US/Firefox/Headless_mode):
npm run test:browser

View File

@ -1,6 +1,6 @@
# Mathjs TypeScript types
The code base of Mathjs is writting in JavaScript. The TypeScript definitions are maintained separately.
The code base of Mathjs is written in JavaScript. The TypeScript definitions are maintained separately.
## Library structure
@ -52,3 +52,15 @@ export const {
// ...
} : Record<string, FactoryFunctionMap>
```
## Testing the type definitions
The types are defined in `types/index.d.ts`.
The tests for the type definitions are located in `test/typescript-types/testTypes.ts`.
To run the tests for the type definitions:
```
npm run test:types
```