refactor(test): Remove unnecessary `noSuchMethod`
Remove trivial implementations in many spy objects which just calls the parent's `noSuchMethod`. Closes #6410 Closes #6491
This commit is contained in:
parent
bd015f14e8
commit
e19b31db29
|
@ -6,9 +6,7 @@ import 'package:angular2/core.dart' show ChangeDetectorRef;
|
||||||
import 'package:angular2/common.dart' show ObservableListDiffFactory;
|
import 'package:angular2/common.dart' show ObservableListDiffFactory;
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyChangeDetectorRef extends SpyObject implements ChangeDetectorRef {
|
class SpyChangeDetectorRef extends SpyObject implements ChangeDetectorRef {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
describe('ObservableListDiff', () {
|
describe('ObservableListDiff', () {
|
||||||
|
|
|
@ -5,16 +5,10 @@ import 'package:angular2/src/core/change_detection/change_detection.dart';
|
||||||
import 'package:angular2/testing_internal.dart';
|
import 'package:angular2/testing_internal.dart';
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyNgControl extends SpyObject implements NgControl {
|
class SpyNgControl extends SpyObject implements NgControl {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyValueAccessor extends SpyObject implements ControlValueAccessor {
|
class SpyValueAccessor extends SpyObject implements ControlValueAccessor {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyChangeDetectorRef extends SpyObject implements ChangeDetectorRef {
|
class SpyChangeDetectorRef extends SpyObject implements ChangeDetectorRef {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
|
@ -5,11 +5,7 @@ import 'package:angular2/testing_internal.dart';
|
||||||
import 'package:angular2/src/compiler/template_compiler.dart';
|
import 'package:angular2/src/compiler/template_compiler.dart';
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyXHR extends SpyObject implements XHR {
|
class SpyXHR extends SpyObject implements XHR {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyTemplateCompiler extends SpyObject implements TemplateCompiler {
|
class SpyTemplateCompiler extends SpyObject implements TemplateCompiler {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
|
@ -13,77 +13,47 @@ import 'package:angular2/src/platform/dom/dom_adapter.dart';
|
||||||
import 'package:angular2/testing_internal.dart';
|
import 'package:angular2/testing_internal.dart';
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyDependencyProvider extends SpyObject implements DependencyProvider {
|
class SpyDependencyProvider extends SpyObject implements DependencyProvider {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyChangeDetector extends SpyObject implements ChangeDetector {
|
class SpyChangeDetector extends SpyObject implements ChangeDetector {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyChangeDispatcher extends SpyObject implements ChangeDispatcher {
|
class SpyChangeDispatcher extends SpyObject implements ChangeDispatcher {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyIterableDifferFactory extends SpyObject
|
class SpyIterableDifferFactory extends SpyObject
|
||||||
implements IterableDifferFactory {
|
implements IterableDifferFactory {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyInjector extends SpyObject implements Injector {
|
class SpyInjector extends SpyObject implements Injector {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyDirectiveResolver extends SpyObject implements DirectiveResolver {
|
class SpyDirectiveResolver extends SpyObject implements DirectiveResolver {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyView extends SpyObject implements AppView {
|
class SpyView extends SpyObject implements AppView {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyProtoView extends SpyObject implements AppProtoView {
|
class SpyProtoView extends SpyObject implements AppProtoView {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyHostViewFactory extends SpyObject implements HostViewFactory {
|
class SpyHostViewFactory extends SpyObject implements HostViewFactory {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyElementRef extends SpyObject implements ElementRef {
|
class SpyElementRef extends SpyObject implements ElementRef {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyAppViewManager extends SpyObject implements AppViewManager_ {
|
class SpyAppViewManager extends SpyObject implements AppViewManager_ {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyRenderer extends SpyObject implements Renderer {
|
class SpyRenderer extends SpyObject implements Renderer {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyRootRenderer extends SpyObject implements RootRenderer {
|
class SpyRootRenderer extends SpyObject implements RootRenderer {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyAppViewListener extends SpyObject implements AppViewListener {
|
class SpyAppViewListener extends SpyObject implements AppViewListener {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyDomAdapter extends SpyObject implements DomAdapter {
|
class SpyDomAdapter extends SpyObject implements DomAdapter {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import 'dart:js';
|
||||||
@proxy
|
@proxy
|
||||||
class SpyApplicationRef extends SpyObject implements ApplicationRef {
|
class SpyApplicationRef extends SpyObject implements ApplicationRef {
|
||||||
tick() {}
|
tick() {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
|
@ -16,11 +15,9 @@ class SpyComponentRef extends SpyObject implements ComponentRef_ {
|
||||||
Injector injector;
|
Injector injector;
|
||||||
|
|
||||||
SpyComponentRef() {
|
SpyComponentRef() {
|
||||||
this.injector =
|
this.injector = Injector
|
||||||
Injector.resolveAndCreate([bind(ApplicationRef).toClass(SpyApplicationRef)]);
|
.resolveAndCreate([bind(ApplicationRef).toClass(SpyApplicationRef)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void callNgProfilerTimeChangeDetection([config]) {
|
void callNgProfilerTimeChangeDetection([config]) {
|
||||||
|
|
|
@ -4,21 +4,14 @@ import 'package:angular2/router.dart';
|
||||||
import 'package:angular2/testing_internal.dart';
|
import 'package:angular2/testing_internal.dart';
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyLocation extends SpyObject implements Location {
|
class SpyLocation extends SpyObject implements Location {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyRouter extends SpyObject implements Router {
|
class SpyRouter extends SpyObject implements Router {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyRouterOutlet extends SpyObject implements RouterOutlet {
|
class SpyRouterOutlet extends SpyObject implements RouterOutlet {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
class SpyPlatformLocation extends SpyObject implements PlatformLocation {
|
class SpyPlatformLocation extends SpyObject implements PlatformLocation {
|
||||||
String pathname;
|
String pathname;
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ class TestObj {
|
||||||
|
|
||||||
class SpyTestObj extends SpyObject {
|
class SpyTestObj extends SpyObject {
|
||||||
constructor() { super(TestObj); }
|
constructor() { super(TestObj); }
|
||||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,15 +60,9 @@ main() {
|
||||||
@proxy
|
@proxy
|
||||||
class SpyMessageEvent extends SpyObject implements MessageEvent {
|
class SpyMessageEvent extends SpyObject implements MessageEvent {
|
||||||
SpyMessageEvent() : super(SpyMessageEvent);
|
SpyMessageEvent() : super(SpyMessageEvent);
|
||||||
noSuchMethod(m) {
|
|
||||||
return super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyWebSocket extends SpyObject implements WebSocket {
|
class SpyWebSocket extends SpyObject implements WebSocket {
|
||||||
SpyWebSocket() : super(SpyWebSocket);
|
SpyWebSocket() : super(SpyWebSocket);
|
||||||
noSuchMethod(m) {
|
|
||||||
return super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,4 @@ import 'package:angular2/src/web_workers/shared/client_message_broker.dart';
|
||||||
import 'package:angular2/testing_internal.dart';
|
import 'package:angular2/testing_internal.dart';
|
||||||
|
|
||||||
@proxy
|
@proxy
|
||||||
class SpyMessageBroker extends SpyObject implements ClientMessageBroker {
|
class SpyMessageBroker extends SpyObject implements ClientMessageBroker {}
|
||||||
noSuchMethod(m) => super.noSuchMethod(m);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue