Skip to content

Commit

Permalink
Ignore mocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
ykmnkmi committed Nov 18, 2023
1 parent c9a9213 commit fdfc472
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ngforms/test/directives_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:ngforms/src/directives/shared.dart';
import 'package:test/test.dart';

@GenerateMocks([ControlValueAccessor])
import 'directives_test.mocks.dart';
import 'directives_test.mocks.dart'; // ignore: uri_does_not_exist

class DummyControlValueAccessor implements ControlValueAccessor<dynamic> {
dynamic writtenValue;
Expand Down Expand Up @@ -67,6 +67,7 @@ void main() {
throwsWith('More than one built-in value accessor matches'));
});
test('should return custom accessor when provided', () {
// ignore: undefined_function
var customAccessor = MockControlValueAccessor();
var checkboxAccessor = CheckboxControlValueAccessor(InputElement());
expect(
Expand All @@ -75,6 +76,7 @@ void main() {
customAccessor);
});
test('should throw when more than one custom accessor is provided', () {
// ignore: undefined_function
var customAccessor = MockControlValueAccessor();
expect(() => selectValueAccessor([customAccessor, customAccessor]),
throwsWith('More than one custom value accessor matches'));
Expand Down
4 changes: 3 additions & 1 deletion ngrouter/test/navigate_by_url_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ import 'package:ngtest/angular_test.dart';
import 'package:test/test.dart';

@GenerateMocks([Router])
import 'navigate_by_url_test.mocks.dart';
import 'navigate_by_url_test.mocks.dart'; // ignore: uri_does_not_exist

void main() {
tearDown(disposeAnyRunningTest);

group('navigateByUrl', () {
// ignore: undefined_class
late MockRouter mockRouter;
late Router router;

setUp(() {
// ignore: undefined_function
mockRouter = MockRouter();
router = DelegatingRouter(mockRouter);
});
Expand Down
4 changes: 3 additions & 1 deletion ngrouter/test/regression/empty_hash_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import 'package:ngrouter/ngrouter.dart';
import 'package:test/test.dart';

@GenerateMocks([PlatformLocation])
import 'empty_hash_test.mocks.dart';
import 'empty_hash_test.mocks.dart'; // ignore: uri_does_not_exist

void main() {
late LocationStrategy locationStrategy;
// ignore: undefined_class
late MockPlatformLocation platformLocation;

group("empty URL doesn't overwrite query parameters", () {
setUp(() {
// ignore: undefined_function
platformLocation = MockPlatformLocation();
locationStrategy = HashLocationStrategy(platformLocation, null);
when(platformLocation.pathname).thenReturn('/foo');
Expand Down
4 changes: 3 additions & 1 deletion ngrouter/test/regression/hash_location_strategy_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import 'package:ngtest/angular_test.dart';
import 'package:test/test.dart';

@GenerateNiceMocks([MockSpec<BrowserPlatformLocation>()])
import 'hash_location_strategy_test.mocks.dart';
import 'hash_location_strategy_test.mocks.dart'; // ignore: uri_does_not_exist

import 'hash_location_strategy_test.template.dart' as ng;

// ignore: undefined_function
final platformLocation = MockBrowserPlatformLocation();

void main() {
Expand Down

0 comments on commit fdfc472

Please sign in to comment.