1.0.0 • Published 4 months ago

doctest-ts-improved v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

doctest-ts-improved: doctests for TypeScript

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 <directory> will create a copy of all .ts-files, containing the runner code. The new files will be named <original-filename>.doctest.ts. To ignore a (group of) files, add --ignore filename.ts or --ignore <directory>/*.ts. Multiple --ignore-flags can be given.

License

MIT

1.0.0

4 months ago

0.9.0

4 months ago

0.9.2

4 months ago

0.9.1

4 months ago

0.8.8

3 years ago

0.8.7

3 years ago

0.8.6

3 years ago

0.8.5

3 years ago

0.8.4

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago