Skip to content

Commit

Permalink
Add testing packages
Browse files Browse the repository at this point in the history
Add unit tests for markdownToHTML function

Refactor markdownToHTML and readFileFromPath
functions

Add unit tests for determinePath function

Add unit testing instructions to CONTRIBUTING.md
Add Jest setup for testing
  • Loading branch information
mismathh committed Nov 11, 2023
1 parent d070678 commit fc128e0
Show file tree
Hide file tree
Showing 7 changed files with 3,866 additions and 38 deletions.
19 changes: 18 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,21 @@ Clone repository and install node packages locally
git clone https://github.com/mismathh/TILerator.git
cd TILerator
npm install -g .
```
```

#### Unit Testing
All tests can be run by using:
```
npm run test
```
A single test can be run by adding the `test filename` to the end of `npm run test`:
```
npm run test "test filename"
```
Tests can be run in watch mode, where they will automatically be run when the test or source code is altered:
```
npm run test:watch
```

#### Writing unit tests
Create new unit tests within the `test/unit` directory with the name of the test ending in `.test.js`. If you are writing tests for the `index.js` file, your test should be named `index.test.js`.

0 comments on commit fc128e0

Please sign in to comment.