Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aelbore/vite-plugin-test
Vite plugin with mocha and puppeteer
https://github.com/aelbore/vite-plugin-test
Last synced: 16 days ago
JSON representation
Vite plugin with mocha and puppeteer
- Host: GitHub
- URL: https://github.com/aelbore/vite-plugin-test
- Owner: aelbore
- Created: 2021-02-06T16:12:37.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-28T17:06:42.000Z (about 3 years ago)
- Last Synced: 2024-10-10T20:47:26.079Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 313 KB
- Stars: 29
- Watchers: 2
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vite-plugin-test
Vite plugin with mocha and puppeteer \
Headless test your `Vue`, `React` and `Lit-Element` componentInstallation
------------
```
npm install --save-dev vite-plugin-test puppeteer
```Getting Started
------------
* `yarn install`
* `yarn build`Example Code
------------
* Vue
```
yarn --cwd examples/vue test
```
* Lit-Element
```
yarn --cwd examples/lit-element test
```
* React
```
yarn --cwd examples/react test
```Options
------------
```typescript
export interface TestPluginOptions {
dir?: string
watch?: boolean
loaders?: {
[ext: string]: Loader
}
}
```* `dir` - [default: 'tests'] directory where the test or spec files
* `watch` - [default: false] enable/diable watch
* `loaders` - when you have a `.js` test files with `jsx` or `tsx` code \
(Please see `./examples/react/vite.config.test.ts`)
```
loaders: {
'.spec.js': 'jsx'
}
```Plugin usage
------------
* Create `vite.config.test.js` file
```typescript
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