Skip to content

Commit

Permalink
docs: document how to run tests for the type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed May 16, 2024
1 parent 599f4ee commit 49df889
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion types/EXPLANATION.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
```

0 comments on commit 49df889

Please sign in to comment.