Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit f82c606

Browse files
committed
Manual changes to generated mocks for analyzer to pass.
1 parent 361a5c5 commit f82c606

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

packages/url_launcher/url_launcher_web/test/integration_test/url_launcher_web_test.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import 'package:integration_test/integration_test.dart';
1111

1212
import 'url_launcher_web_test.mocks.dart';
1313

14-
@GenerateMocks([], customMocks: [
15-
MockSpec<html.Window>(returnNullOnMissingStub: true),
16-
MockSpec<html.Navigator>(returnNullOnMissingStub: true)
17-
])
14+
@GenerateMocks([html.Window, html.Navigator])
1815
void main() {
1916
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
2017

packages/url_launcher/url_launcher_web/test/integration_test/url_launcher_web_test.mocks.dart

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import 'dart:async' as _i4;
22
import 'dart:html' as _i2;
33
import 'dart:math' as _i5;
4-
import 'dart:web_sql' as _i3;
54

65
import 'package:mockito/mockito.dart' as _i1;
76

87
// ignore_for_file: comment_references
98

109
// ignore_for_file: unnecessary_parenthesis
1110

11+
// ignore_for_file: extra_positional_arguments_could_be_named
12+
1213
class _FakeDocument extends _i1.Fake implements _i2.Document {}
1314

1415
class _FakeLocation extends _i1.Fake implements _i2.Location {}
@@ -38,8 +39,6 @@ class _FakeMediaQueryList extends _i1.Fake implements _i2.MediaQueryList {}
3839

3940
class _FakeEntry extends _i1.Fake implements _i2.Entry {}
4041

41-
class _FakeSqlDatabase extends _i1.Fake implements _i3.SqlDatabase {}
42-
4342
class _FakeGeolocation extends _i1.Fake implements _i2.Geolocation {}
4443

4544
class _FakeMediaStream extends _i1.Fake implements _i2.MediaStream {}
@@ -51,6 +50,10 @@ class _FakeRelatedApplication extends _i1.Fake
5150
///
5251
/// See the documentation for Mockito's code generation for more information.
5352
class MockWindow extends _i1.Mock implements _i2.Window {
53+
MockWindow() {
54+
_i1.throwOnMissingStub(this);
55+
}
56+
5457
@override
5558
_i4.Future<num> get animationFrame =>
5659
(super.noSuchMethod(Invocation.getter(#animationFrame), Future.value(0))
@@ -526,14 +529,6 @@ class MockWindow extends _i1.Mock implements _i2.Window {
526529
void moveTo(_i5.Point<num>? p) =>
527530
super.noSuchMethod(Invocation.method(#moveTo, [p]));
528531
@override
529-
_i3.SqlDatabase openDatabase(String? name, String? version,
530-
String? displayName, int? estimatedSize,
531-
[_i2.DatabaseCallback? creationCallback]) =>
532-
(super.noSuchMethod(
533-
Invocation.method(#openDatabase,
534-
[name, version, displayName, estimatedSize, creationCallback]),
535-
_FakeSqlDatabase()) as _i3.SqlDatabase);
536-
@override
537532
void addEventListener(String? type, _i2.EventListener? listener,
538533
[bool? useCapture]) =>
539534
super.noSuchMethod(
@@ -559,6 +554,10 @@ class MockWindow extends _i1.Mock implements _i2.Window {
559554
///
560555
/// See the documentation for Mockito's code generation for more information.
561556
class MockNavigator extends _i1.Mock implements _i2.Navigator {
557+
MockNavigator() {
558+
_i1.throwOnMissingStub(this);
559+
}
560+
562561
@override
563562
String get language =>
564563
(super.noSuchMethod(Invocation.getter(#language), '') as String);

0 commit comments

Comments
 (0)