chore: fix namespaces

This commit is contained in:
2026-07-04 22:40:58 +02:00
parent 832b9b2bad
commit 9d3ef431b0
6 changed files with 66 additions and 26 deletions
+31
View File
@@ -6,6 +6,8 @@ Generate tests from your JSDoc documentation for whichever testing harness you p
> See `gen-doctests --help` for more detail.
### Generate tests
Write a doctest alongside your source code:
````ts
@@ -47,6 +49,8 @@ test("isEven()", () => {
});
```
### Config
You can also define a `doctests.config.ts` file to skip the command arguments:
```ts
@@ -58,3 +62,30 @@ export default defineConfig({
outDir: "dist/",
});
```
### Skipping tests
You can specify that a test should be ignored or that it fails by specifying
that next to the language tag of the code block:
````ts
/**
* ...
* @example
* ```ts ignore
* // this test is ignored
* ```
* @example
* ```ts fails
* // this test is expected to fail
* expect(1).toBe(2)
* ```
*/
````
If you use the `--must-assert` flag or `onlyGenerateTests` option then tests
which do not use any assertions will not be included in emitted test files.
## License
Published under [MIT License](./LICENSE)