Skip to content

Commit

Permalink
test: set up non-integration testing (#9)
Browse files Browse the repository at this point in the history
* test: set up non-integration testing

* pass github token

* allow commenting on pull request
  • Loading branch information
boringcactus authored Dec 4, 2023
1 parent 62f9975 commit 2ac94e9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
permissions:
id-token: write
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Read asdf versions
Expand All @@ -29,7 +30,15 @@ jobs:
- name: Analyze
run: flutter analyze .
- name: Format
run: dart format lib --set-exit-if-changed
run: dart format lib test --set-exit-if-changed
- name: Test
run: flutter test --coverage
- name: Report test coverage
uses: mbta/github-actions-report-lcov@v1
with:
coverage-files: coverage/lcov.info
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ migrate_working_dir/
.pub-cache/
.pub/
/build/
/coverage/

# Symbolication related
app.*.symbols
Expand Down
11 changes: 11 additions & 0 deletions test/main_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'package:flutter_test/flutter_test.dart';

import 'package:mbta_app/main.dart';

void main() {
testWidgets("Home should say \"Hello World!\"", (tester) async {
await tester.pumpWidget(const MainApp());

expect(find.text("Hello World!"), findsOneWidget);
});
}

0 comments on commit 2ac94e9

Please sign in to comment.