0.0.5 • Published 5 years ago
vite-plugin-test v0.0.5
vite-plugin-test
Vite plugin with mocha and puppeteer \
Headless test your Vue, React and Lit-Element component
Installation
npm install --save-dev vite-plugin-test puppeteerGetting Started
yarn installyarn build
Example Code
- Vue
yarn --cwd examples/vue test - Lit-Element
yarn --cwd examples/lit-element test - React
yarn --cwd examples/react test
Options
export interface TestPluginOptions {
dir?: string
watch?: boolean
loaders?: {
[ext: string]: Loader
}
}dir- default: 'tests' directory where the test or spec fileswatch- default: false enable/diable watchloaders- when you have a.jstest files withjsxortsxcode \ (Please see./examples/react/vite.config.test.ts)loaders: { '.spec.js': 'jsx' }
Plugin usage
- Create
vite.config.test.jsfile
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import viteTestPlugin from 'vite-plugin-test'
export default defineConfig({
plugins: [
vue(),
viteTestPlugin({
watch: true
})
]
})vite --config vite.config.test.js
TODO
- Code Coverage
0.0.5
5 years ago
0.0.5-beta.1
5 years ago
0.0.4-beta.1
5 years ago
0.0.4
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago