https://github.com/link89/ava-demo
https://github.com/link89/ava-demo
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/link89/ava-demo
- Owner: link89
- Created: 2020-05-26T17:10:05.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-03T04:08:49.000Z (almost 6 years ago)
- Last Synced: 2025-02-02T00:47:51.101Z (over 1 year ago)
- Language: TypeScript
- Size: 37.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ava-demo
## 01. code coverage collection and transform
### Summary
This case is about
* how to collect code coverage data on a `selenium` based test automation project via `cdp`
* how to covert v8-format coverage data to istanbul-format
### Run demo
This demo depends on `selenium`. You can install `selenium-standalone` and start a selenium server with it before you execute the example.
Execute the example
`npx ava --timeout=2m 01-webdriver-and-puppeteer.test.ts`
The v8-format coverage data will be in `v8-coverage.json`, convert it to istanbul-format via following command.
`npx ts-node bin/to-istanbul-cov.ts cache output v8-coverage.json`
You will get istanbul-format coverage data under `output` folder.
Before generate coverage, you may need to restore the source code via source map data.
`npx shuji cache/sources`
Now you can generate html format report by following command
`npx nyc report -t output --reporter html --report-dir output-html`
You can start a http server to view the report in browser
`npx http-server output-html`
## 02. coroutine level concurrency