Skip to content

Commit

Permalink
Add instructions on how to debug tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mwhirls committed Jan 29, 2024
1 parent 8fa5073 commit a55cd21
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,34 @@ This library builds on top of kuromoji to group the morphemes it produces into f

See the test cases under '/test/' to get a sense of the types of tokens bunsetsu groups together as a single word unit.

## Debugging Unit Tests in VSCode

The source code is written in Typescript using ES modules, and the unit tests are written using [MochaJS](https://mochajs.org/). In order to debug the Typescript unit tests, you must run the tests with `ts-node`. Add the following configuration to your `launch.json` file in VSCode to get started:

```
{
"args": [
"${workspaceRoot}/test/**/*.spec.ts",
"--no-timeouts"
],
"runtimeArgs": [
"--loader",
"ts-node/esm",
],
"env": {
"TS_NODE_LOG_ERROR": "true"
},
"internalConsoleOptions": "openOnSessionStart",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
}
```

## License

bunsetsu is licensed under the MIT license.
Expand Down

0 comments on commit a55cd21

Please sign in to comment.