ssssota / doc-vitest

Documentation tests with Vitest
https://npmjs.com/vite-plugin-doctest
62 stars 0 forks source link

Test discovery in `class`es fails unless all fields contain doctest #58

Closed Iron-E closed 8 months ago

Iron-E commented 8 months ago

Hello! Thank you for this plugin. I sorely missed doctests, coming from Rust.

Here is a minimum example of the issue:

class Foo {
    public constructor() { }

    /** some note about this property */ // ← this causes the test discovery to fail
    private readonly bar: number = 3;

    /**
     * @import.meta.vitest
     * ```ts
     * assert(false);
     * ```
     */
    public readonly baz = (): void => { }
}
ssssota commented 8 months ago

Thank you for using! I have fixed this issue. Please check v0.1.3!