From cec7575861248cef310378ced99f0fde64d671bf Mon Sep 17 00:00:00 2001 From: Yelaman Yelmuratov Date: Thu, 9 May 2024 23:52:24 +0500 Subject: [PATCH] . e added dependabot, configure github action, added codecov config --- .github/dependabot.yml | 6 ++++++ .github/workflows/build_and_test.yml | 10 ++++++++++ README.md | 11 +++++++---- TODO.md | 29 ++++++++++++++++++++++------ build_and_test.sh | 6 +++++- pubspec.yaml | 2 +- test/approval_test.dart | 3 ++- 7 files changed, 54 insertions(+), 13 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9096371 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 2f4554a..1c935fd 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -21,3 +21,13 @@ jobs: run: | ./build_and_test.sh shell: bash + - name: Check Code Coverage + uses: VeryGoodOpenSource/very_good_coverage@v2.2.0 + with: + path: coverage/lcov.info + min_coverage: 30 + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 01359e9..f1968ac 100644 --- a/README.md +++ b/README.md @@ -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) -

@@ -21,14 +19,19 @@ Pub popularity Pub points

+

+ Build and test badge +

## 📖 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. 🙏 diff --git a/TODO.md b/TODO.md index e658c75..8a685ca 100644 --- a/TODO.md +++ b/TODO.md @@ -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 \ No newline at end of file +* [ ] 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 \ No newline at end of file diff --git a/build_and_test.sh b/build_and_test.sh index 95d914d..7e064cb 100755 --- a/build_and_test.sh +++ b/build_and_test.sh @@ -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 \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 7ffd99e..2d04063 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 diff --git a/test/approval_test.dart b/test/approval_test.dart index 5b5ec67..8054ed2 100644 --- a/test/approval_test.dart +++ b/test/approval_test.dart @@ -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',