generated from blueplum/typescript-template
chore: fix namespaces
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user