Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: third_party/pkg/angular/lib/mock/test_injection.dart

Issue 257423008: Update all Angular libs (run update_all.sh). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/pkg/angular/lib/mock/test_bed.dart ('k') | third_party/pkg/angular/lib/mock/zone.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/angular/lib/mock/test_injection.dart
diff --git a/third_party/pkg/angular/lib/mock/test_injection.dart b/third_party/pkg/angular/lib/mock/test_injection.dart
index 2ca2b6c2c947446e96d14ff66b6c4e95734d475f..c3201d4ed34d980d07412cd8440fa7cf3a1c208c 100644
--- a/third_party/pkg/angular/lib/mock/test_injection.dart
+++ b/third_party/pkg/angular/lib/mock/test_injection.dart
@@ -1,4 +1,9 @@
-part of angular.mock;
+library angular.mock.test_injection;
+
+import 'package:angular/application_factory.dart';
+import 'package:angular/mock/module.dart';
+import 'package:di/di.dart';
+import 'package:di/dynamic_injector.dart';
_SpecInjector _currentSpecInjector = null;
@@ -68,11 +73,14 @@ class _SpecInjector {
*
* NOTE: Calling inject creates an injector, which prevents any more calls to [module].
*
+ * NOTE: [inject] will never return the result of [fn]. If you need to return a [Future]
+ * for unittest to consume, take a look at [async], [clockTick], and [microLeap] instead.
+ *
* Typical usage:
*
* test('wrap whole test', inject((TestBed tb) {
* tb.compile(...);
- * });
+ * }));
*
* test('wrap part of a test', () {
* module((Module module) {
@@ -127,7 +135,9 @@ module(fnOrModule) {
void setUpInjector() {
_currentSpecInjector = new _SpecInjector();
_currentSpecInjector.module((Module m) {
- m..install(new AngularModule())..install(new AngularMockModule());
+ m
+ ..install(applicationFactory().ngModule)
+ ..install(new AngularMockModule());
});
}
« no previous file with comments | « third_party/pkg/angular/lib/mock/test_bed.dart ('k') | third_party/pkg/angular/lib/mock/zone.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698