vitest icon indicating copy to clipboard operation
vitest copied to clipboard

Any plan for documentation test like rust?

Open legend80s opened this issue 2 years ago • 0 comments

Clear and concise description of the problem

As a developer using Vitest I wish an exciting feature - "documentation comments test" like rust.

Nothing is better than documentation with examples. But nothing is worse than examples that don't work because the code has changed since the documentation was written.

https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#documentation-comments-as-tests

Suggested solution

when we run Vitest, it will run the tests in documentation comments.

Alternative

No response

Additional context

No response

Validations

legend80s avatar Mar 20 '23 02:03 legend80s