Skip to content

Commit

Permalink
. e added dependabot, configure github action, added codecov config
Browse files Browse the repository at this point in the history
  • Loading branch information
yelmuratoff committed May 9, 2024
1 parent ba19fae commit cec7575
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
10 changes: 10 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@ jobs:
run: |
./build_and_test.sh
shell: bash
- name: Check Code Coverage
uses: VeryGoodOpenSource/[email protected]
with:
path: coverage/lcov.info
min_coverage: 30

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Build and test](https://github.com/approvals/ApprovalTests.Dart/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/approvals/ApprovalTests.Dart/actions/workflows/build_and_test.yml)

<div align="center">
<p align="center">
<a href="https://github.com/approvals/ApprovalTests.Dart" align="center">
Expand All @@ -21,14 +19,19 @@
<a href="https://pub.dev/packages/approval_tests/score"><img src="https://img.shields.io/pub/popularity/approval_tests?logo=flutter" alt="Pub popularity"></a>
<a href="https://pub.dev/packages/approval_tests/score"><img src="https://img.shields.io/pub/points/approval_tests?logo=flutter" alt="Pub points"></a>
</p>
<p align="center">
<a href="https://github.com/approvals/ApprovalTests.Dart/actions/workflows/build_and_test.yml"><img src="https://github.com/approvals/ApprovalTests.Dart/actions/workflows/build_and_test.yml/badge.svg" alt="Build and test badge"></a>
</p>

## 📖 About

Unit testing asserts can be **difficult** to use. `Approval tests` simplify this by taking a snapshot of the results, and confirming that they have not changed.
**[Approval Tests](https://approvaltests.com/)** are an alternative to assertions. You’ll find them useful for testing objects with complex values *(such as long strings)*, lots of properties, or collections of objects.

`Approval tests` simplify this by taking a snapshot of the results, and confirming that they have not changed.

In normal unit testing, you say `expect(person.getAge(), 5)`. Approvals allow you to do this when the thing that you want to assert is no longer a primitive but a complex object. For example, you can say, `Approvals.verify(person)`.

I am writing an implementation of a great tool like **[Approval Tests](https://approvaltests.com/)** in Dart. If anyone wants to help, please **[text](https://t.me/yelmuratoff)** me. 🙏
I am writing an implementation of **[Approval Tests](https://approvaltests.com/)** in Dart. If anyone wants to help, please **[text](https://t.me/yelmuratoff)** me. 🙏

<!-- At the moment the package is **in development** and <u>not ready</u> to use. 🚧 -->

Expand Down
29 changes: 23 additions & 6 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
* [x] Github actions
* [x] Building run script
# TODO

This is the markdown todo file for Approval Tests.

## Tasks

Tasks for the project are listed below:

* [ ] Check the causes of incorrect file paths in Windows
* [ ] Markdown snippets
* [ ] Startup project
* [x] Add badges
* [ ] Add dependabot
* [ ] Deploy
* [ ] Deploy script
* [ ] Deploy script to automate the deployment process to pub.dev
* [ ] Add codecov and coverage badge
* [ ] Add contributing guide
* [ ] Cover the project completely with tests
* [ ] Refactor the code based on ApprovalTests architectural rules
* [ ] Add more detailed documentation to the project

# DONE

* [x] Github actions
* [x] Building run script
* [x] Add badges
* [x] Add dependabot
* [x] Deploy to pub.dev
6 changes: 5 additions & 1 deletion build_and_test.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
#!/bin/bash -e
dart run test
# chmod +x build_and_test.sh
dart pub get
dart format .
dart analyze
dart run test --coverage=./coverage && dart pub global run coverage:format_coverage --packages=.dart_tool/package_config.json --report-on=lib --lcov -o ./coverage/lcov.info -i ./coverage
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# * 0.0.4 for a minor release.
name: approval_tests
description: Approval Tests implementation in Dart. Inspired by ApprovalTests.
version: 0.3.3-dev
version: 0.3.4-dev
repository: https://github.com/K1yoshiSho/approval_tests_dart
homepage: https://github.com/K1yoshiSho/approval_tests_dart.git
issue_tracker: https://github.com/K1yoshiSho/approval_tests_dart/issues
Expand Down
3 changes: 2 additions & 1 deletion test/approval_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ void main() {
);
});

test("Method «verify» must throw DoesntMatchException with error handling", () {
test("Method «verify» must throw DoesntMatchException with error handling",
() {
expect(
() => helper.verify(
'Hello W0rld',
Expand Down

0 comments on commit cec7575

Please sign in to comment.