title: Injection in the setUp() method causes the framework not to wait for the Future to complete
body: <p>I am testing an AngularDart component. I am trying to fetch the template and put it in <code>TemplateCache</code> in the <code>setUp()</code> method. For this I need to inject the template cache. However the inject in the <code>setUp()</code> makes the framework continue to the test method and not waiting for the <code>Future</code> to complete. Here is a simplified example. </p>
  
  
  
  <pre class="lang-dart prettyprint-override"><code>import 'dart:async';
  import 'package:angular/angular.dart';
  import 'package:mock/mock.dart';
  import 'package:unittest/unittest.dart';
  import 'package:angular/mock/test_injection.dart';
  import 'package:angular/mock/module.dart';
  import 'package:di/di.dart';
  
  
  class MyTest {
  
    static main() {
  
      group("SetUp with future that waits", () {
        setUp(() {
          return new Future.value("First").then((_) =&gt; print(_));
        });
  
        test("Welcome to the world of tomorrow!", () {
          print("Second");
        });
      });
  
      group("SetUp with future that doesn't wait", () {
        setUp(inject((Injector inject) { // injection causes the test to not wait
          return new Future.value("First").then((_) =&gt; print(_));
        }));
  
        test("Welcome to the world of tomorrow!", () {
          print("Second");
        });
      });
    }
  }
  </code></pre>
  
  <p>In the console you can see the printed messages: First, Second, Second, First.</p>
  
  <p>I think it must be that the <code>inject</code> is not returning the <code>Future</code>. What else can I do to both have the framework injecting objects that I need and waiting for the <code>Future</code> in the <code>setUp()</code>?</p>