Skip to content

Commit

Permalink
refactor(ngrouter): fix all static warnings (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykmnkmi authored Apr 28, 2023
1 parent 629c87c commit 254bcb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
5 changes: 1 addition & 4 deletions ngrouter/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ include: ../analysis_options.yaml
analyzer:
errors:
# False positives related to missing .template.dart files
argument_type_not_assignable: ignore
invalid_assignment: ignore
return_of_invalid_type: ignore
return_of_invalid_type_from_closure: ignore
implementation_imports: ignore
11 changes: 5 additions & 6 deletions ngrouter/test/revert_popstate_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:async' show Completer;
import 'dart:html' show window;

import 'package:test/test.dart';
Expand Down Expand Up @@ -47,26 +46,26 @@ void main() {
// resolved. In order to be sure we're testing the correct state, we listen
// for the next `popstate` event and use a completer to signal that it has
// occured.
var nextPopState = Completer<void>()..complete(window.onPopState.first);
var nextPopState = window.onPopState.first;
// Prevent navigation on back button.
await testFixture.update((_) {
routerHook.canLeave = false;
location.back();
});
// In rare cases, not waiting for this `popstate` event causes the
// subsequent code to execute first.
await nextPopState.future;
await nextPopState;

// Location should not have changed.
expect(location.path(), '/c');

nextPopState = Completer<void>()..complete(window.onPopState.first);
nextPopState = window.onPopState.first;
// Allow navigation on back button.
await testFixture.update((_) {
routerHook.canLeave = true;
location.back();
});
await nextPopState.future;
await nextPopState;

// Location should now be the correct previous history location.
expect(location.path(), '/b');
Expand All @@ -79,7 +78,7 @@ const testModule = Module(
);

@GenerateInjector.fromModules([testModule])
final createInjector = ng.createInjector$Injector;
final InjectorFactory createInjector = ng.createInjector$Injector;

@Component(
selector: 'test',
Expand Down

0 comments on commit 254bcb7

Please sign in to comment.