https://github.com/dnlup/vue-cli-plugin-unit-ava
@vue/cli plugin to run unit tests with ava
https://github.com/dnlup/vue-cli-plugin-unit-ava
ava cli-plugin testing tests unit vue vue-cli vue-cli-3 vue-cli-plugin vuejs
Last synced: 3 months ago
JSON representation
@vue/cli plugin to run unit tests with ava
- Host: GitHub
- URL: https://github.com/dnlup/vue-cli-plugin-unit-ava
- Owner: dnlup
- License: mit
- Created: 2019-03-15T16:09:45.000Z (about 6 years ago)
- Default Branch: next
- Last Pushed: 2022-12-10T16:58:05.000Z (over 2 years ago)
- Last Synced: 2025-03-16T16:44:21.485Z (3 months ago)
- Topics: ava, cli-plugin, testing, tests, unit, vue, vue-cli, vue-cli-3, vue-cli-plugin, vuejs
- Language: JavaScript
- Homepage:
- Size: 3.8 MB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://badge.fury.io/js/%40dnlup%2Fvue-cli-plugin-unit-ava)
[](https://travis-ci.com/dnlup/vue-cli-plugin-unit-ava) [](https://greenkeeper.io/)
[](https://codeclimate.com/github/dnlup/vue-cli-plugin-unit-ava/maintainability)
[](https://codeclimate.com/github/dnlup/vue-cli-plugin-unit-ava/test_coverage)
# @dnlup/vue-cli-plugin-unit-ava
> unit-ava plugin for vue-cli
## Table of contents
* [Injected commands](#injected-commands)
* [Installing in an Already Created Project](#installing-in-an-already-created-project)
* [Contributing](#contributing)### Injected commands
- **`vue-cli-service test:unit`**
Run unit tests with [ava](https://github.com/avajs/ava)
**Note the tests are run inside Node.js with browser environment simulated with [browser-env](https://github.com/lukechilds/browser-env).**
```
Usage: vue-cli-service test:unit [options] [ ...]Options:
--watch, -w Re-run tests when tests and source files change
--match, -m Only run tests with matching title (Can be repeated)
--update-snapshots, -u Update snapshots
--fail-fast Stop after first test failure
--timeout, -T Set global timeout
--serial, -s Run tests serially
--concurrency, -c Max number of test files running at the same time (Default: CPU cores)
--verbose, -v Enable verbose output
--tap, -t Generate TAP output
--color Force color output
--no-color Disable color output
```Default files matches are: any files in `tests/unit` that end in `.spec.(ts|js)`.
All [command line options](https://github.com/avajs/ava/blob/master/docs/05-command-line.md) are supported.
### Installing in an Already Created Project
```bash
$ vue add @dnlup/unit-ava
```#### Prompts
Will merge or create a new configuration in the selected destination. It will fail if the project is already configured in the destination **not** selected.

Will add support for a specific UI Framework. It currently supports only the latest version of [Vuetify](https://vuetifyjs.com/en/).

Will ask if you want to add style loaders.
### Contributing
* Make your changes
* Test them with `npm test`
* Add them
```bash
$ git add
```
* Commit (uses [commitizen](https://github.com/commitizen/cz-cli))
```bash
$ git commit
```#### Note
Tests now are a bit heavy because I am actually creating a considerable amount of projects in parallel to test different configurations.
All configurations cannot be tested, it would be too expensive.