https://github.com/bahmutov/code-coverage-vue-example
Code coverage for Vue single file components from Cypress.io end-to-end tests
https://github.com/bahmutov/code-coverage-vue-example
cypress-code-coverage-example
Last synced: 6 months ago
JSON representation
Code coverage for Vue single file components from Cypress.io end-to-end tests
- Host: GitHub
- URL: https://github.com/bahmutov/code-coverage-vue-example
- Owner: bahmutov
- License: mit
- Created: 2019-06-21T15:27:35.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-28T07:10:41.000Z (9 months ago)
- Last Synced: 2024-10-03T14:14:09.153Z (9 months ago)
- Topics: cypress-code-coverage-example
- Language: Vue
- Homepage: https://on.cypress.io/code-coverage
- Size: 1.17 MB
- Stars: 13
- Watchers: 1
- Forks: 7
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# code-coverage-vue-example [![renovate-app badge][renovate-badge]][renovate-app] [](https://circleci.com/gh/bahmutov/code-coverage-vue-example/tree/master) [](https://coveralls.io/github/bahmutov/code-coverage-vue-example)
> Code coverage for Vue single file components from Cypress.io end-to-end testsUses [@cypress/code-coverage](https://github.com/cypress-io/code-coverage) plugin for [Cypress.io](https://www.cypress.io) test runner. See [https://on.cypress.io/code-coverage](https://on.cypress.io/code-coverage) documentation.

Individual `.vue` file coverage

Because this application is served using `webpack-dev-server, it instruments the application code following the example in [bahmutov/code-coverage-webpack-dev-server](https://github.com/bahmutov/code-coverage-webpack-dev-server) via [.babelrc](.babelrc) and [webpack.config.js](webpack.config.js) files.
## Coveralls
You can find the code coverage for this project at [https://coveralls.io/github/bahmutov/code-coverage-vue-example](https://coveralls.io/github/bahmutov/code-coverage-vue-example). To send the coverage information there:
- install [coveralls](https://github.com/nickmerwin/node-coveralls) npm module with `npm i -D coveralls`
- add npm script to [package.json](package.json)
```json
{
"scripts": {
"coveralls": "nyc report --reporter=text-lcov | coveralls"
}
}
```
- after the tests call the above command, see [.circleci/config.yml](.circleci/config.yml)
```
- run: npm run coveralls
```
- on CircleCI set two environment variables
```
COVERALLS_REPO_TOKEN=... (token from Coveralls.io)
COVERALLS_SERVICE_NAME=circleci
```## License
This project is licensed under the terms of the [MIT license](/LICENSE.md).
[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg
[renovate-app]: https://renovateapp.com/