doctest support for typescript with Mocha
Easy doctests for typescript modules, including private methods and extra imports:
```
export default class SomeClass {
/**
* Gets the field doubled
* @example xyz
*
* import OtherClass from "./OtherClass";
*
* // Should equal 42
* SomeClass.get() // => 42
*
* SomeClass.get() + 1 // => 43
*
* new OtherClass().doSomething(new SomeClass()) // => 5
*/
private static get() : number{
// a comment
// @ts-ignore
return 42
}
}
Running doctest-ts-improved will create a copy of all .ts-files, containing the runner code. The new files will be named .--ignore filename.ts
To ignore a (group of) files, add or --ignore . Multiple --ignore`-flags can be given.
MIT