From 49df88985eacb40e3de60b3cdbe201b2feb901db Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Thu, 16 May 2024 08:46:58 +0200 Subject: [PATCH] docs: document how to run tests for the type definitions --- README.md | 4 ++++ types/EXPLANATION.md | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 44c6e82f4..bb61a0b6a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/types/EXPLANATION.md b/types/EXPLANATION.md index 0bcb7b0ba..8f83778aa 100644 --- a/types/EXPLANATION.md +++ b/types/EXPLANATION.md @@ -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 ``` + +## 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 +```