doc-vitest
doc-vitest copied to clipboard
Add example for Nuxt
I would like to try it with nuxt.
Can the setup be done with nuxt.config.ts?
Tried:
import { doctest } from 'vite-plugin-doctest';
export default defineNuxtConfig({
plugins: [doctest({ /* options */ })],
test: {
includeSource: [
'./src/**/*.[jt]s?(x)',
'./**/*.md', // You can disable markdown test by removing this line
],
},
})
But it returns an error
If you want to use vitest at Nuxt project, you should put a vitest.config.ts (official document).
And, you can configuration testing at vitest.config.ts.
Here is the example! https://stackblitz.com/edit/nuxt-doctest?file=vitest.config.ts,functions%2Fsome-function.ts
fyi: vite-plugin-doctest cannot test comment in .vue files.