diff --git a/.github/workflows/flutter-ci.yml b/.github/workflows/flutter-ci.yml index 238990f..ccbad0b 100644 --- a/.github/workflows/flutter-ci.yml +++ b/.github/workflows/flutter-ci.yml @@ -48,6 +48,12 @@ jobs: - name: Run formatter run: flutter format --set-exit-if-changed . + - name: Run analyzer + run: flutter analyze . + + - name: Run tests + run: flutter test + - name: Build release APKs run: flutter build apk --split-per-abi env: diff --git a/lib/main.dart b/lib/main.dart index 1a8fc9d..77b3696 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,3 @@ -// @dart=2.9 import 'package:bttvstickers/constants.dart'; import 'package:bttvstickers/models/pack.dart'; import 'package:bttvstickers/models/settings.dart'; diff --git a/pubspec.lock b/pubspec.lock index 0e3db92..b8058e9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -77,35 +77,35 @@ packages: name: firebase url: "https://pub.dartlang.org" source: hosted - version: "9.0.0" + version: "9.0.1" firebase_analytics: dependency: "direct main" description: name: firebase_analytics url: "https://pub.dartlang.org" source: hosted - version: "7.1.1" + version: "8.0.0-dev.2" firebase_analytics_platform_interface: dependency: transitive description: name: firebase_analytics_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "2.0.0-dev.0" firebase_analytics_web: dependency: transitive description: name: firebase_analytics_web url: "https://pub.dartlang.org" source: hosted - version: "0.2.0+1" + version: "0.3.0-dev.0" firebase_core: dependency: "direct main" description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.3" firebase_core_platform_interface: dependency: transitive description: @@ -119,7 +119,7 @@ packages: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" flutter: dependency: "direct main" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index fa1a3bb..8809fd7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: path_provider: ^2.0.1 transparent_image: ^2.0.0-nullsafety.0 firebase_core: ^1.0.1 - firebase_analytics: ^7.1.1 + firebase_analytics: ^8.0.0-dev.2 dev_dependencies: flutter_test: diff --git a/test/widget_test.dart b/test/widget_test.dart index 231799b..929359f 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -1,30 +1,22 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - +import 'package:bttvstickers/main.dart'; +import 'package:bttvstickers/models/pack.dart'; +import 'package:bttvstickers/models/settings.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; - -import 'package:bttvstickers/main.dart'; +import 'package:provider/provider.dart'; void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(App()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); + testWidgets('Main page loads smoke test', (WidgetTester tester) async { + await tester.pumpWidget( + MultiProvider( + providers: [ + ChangeNotifierProvider(create: (context) => Settings()), + ChangeNotifierProvider(create: (context) => Pack()), + ], + child: Builder( + builder: (_) => App(), + ), + ), + ); }); }