diff --git a/.github/workflows/unit_test.yaml b/.github/workflows/unit_test.yaml new file mode 100644 index 0000000..7fff1af --- /dev/null +++ b/.github/workflows/unit_test.yaml @@ -0,0 +1,35 @@ +# This workflow will test the Dart code in the repository +# to make sure that the quality of the code is high. +name: Dart +on: + push: + # Run the workflow on the master branch on push + branches: [ "master" ] + pull_request: + # Run the workflow on the master branch on pull requests + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: 3.24.0 + # Install dependencies + - name: Install dependencies + run: flutter pub get + + # Check for formatting issues + - name: Check formatting + run: dart format --set-exit-if-changed . + + # Analyze the project source + - name: Analyze project source + run: flutter analyze --fatal-infos --fatal-warnings + + # Run test to ensure that the code is working as expected + - name: Run tests + run: flutter test \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml index 95540a5..64f885c 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -17,3 +17,4 @@ analyzer: linter: rules: prefer_constructors_over_static_methods: false + sort_pub_dependencies: false diff --git a/lib/src/model/error_model.dart b/lib/src/model/error_model.dart index 6022592..a6660c5 100644 --- a/lib/src/model/error_model.dart +++ b/lib/src/model/error_model.dart @@ -7,7 +7,7 @@ final class ErrorModel?> extends IErrorModel { /// Error model for network response /// [statusCode] Error status code as http result /// [description] Error message - const ErrorModel({super.statusCode, super.description, super.model}); + const ErrorModel({super.statusCode, super.description, super.model}); /// Null is returned after parsing a model factory ErrorModel.parseError() { diff --git a/test/unit/model/network_manager_test.dart b/test/unit/model/network_manager_test.dart index e69de29..a2ee741 100644 --- a/test/unit/model/network_manager_test.dart +++ b/test/unit/model/network_manager_test.dart @@ -0,0 +1,5 @@ +import 'package:flutter_test/flutter_test.dart'; + +void main() { + setUp(() {}); +}