Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add tests on ci #18

Merged
merged 7 commits into from
Jul 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,36 @@ Out of the box, on each pull request and push, the CI `formats`, `lints`, and `t

## Running Tests 🧪

To run all unit tests:
This project uses [melos][melos_link] for convenience scripts such as running tests and coverage. All of these scripts can be run from any directory in the project, and are defined in the root `melos.yaml` file.

To activate melos, run the following command:

```sh
dart pub global activate melos
```

After that, to run all unit tests:

```sh
melos test
```

To run all tests and generate coverage report:
giboin marked this conversation as resolved.
Show resolved Hide resolved

```sh
dart pub global activate coverage 1.2.0
dart test --coverage=coverage
dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info
melos test:cov
```

To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov).
To view the generated coverage report using [lcov][lcov_link] in your browser, run:

```sh
# Generate Coverage Report
genhtml coverage/lcov.info -o coverage/
melos open:cov
```

If you want to reproduce the CI analyze job locally, you can run:

# Open Coverage Report
open coverage/index.html
```sh
melos analyze
```

[dart_install_link]: https://dart.dev/get-dart
Expand All @@ -60,3 +74,5 @@ open coverage/index.html
[very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only
[very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only
[very_good_workflows_link]: https://github.com/VeryGoodOpenSource/very_good_workflows
[lcov_link]: https://github.com/linux-test-project/lcov
[melos_link]: https://melos.invertase.dev/
Loading