| Index: test/runner/engine_test.dart
|
| diff --git a/test/runner/engine_test.dart b/test/runner/engine_test.dart
|
| index b3e7ad13a69151f20d4136af8cd7ee9046b3ee32..37a8120effd55bfc74aad5a8082aa4ffabb7ca0c 100644
|
| --- a/test/runner/engine_test.dart
|
| +++ b/test/runner/engine_test.dart
|
| @@ -2,6 +2,8 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| +import 'dart:async';
|
| +
|
| import 'package:test/src/backend/group.dart';
|
| import 'package:test/src/backend/state.dart';
|
| import 'package:test/src/runner/engine.dart';
|
| @@ -113,6 +115,42 @@ void main() {
|
| expect(engine.run, throwsStateError);
|
| });
|
|
|
| + test("runs tearDown after a test times out", () {
|
| + // Declare this here so the expect is in the context of this test, rather
|
| + // than the inner test.
|
| + var secondTestStarted = false;
|
| + var firstTestFinished = false;
|
| + var tearDownBody = expectAsync(() {
|
| + print("running teardown");
|
| + expect(secondTestStarted, isFalse);
|
| + expect(firstTestFinished, isFalse);
|
| + });
|
| +
|
| + var engine = declareEngine(() {
|
| + // This ensures that the first test doesn't actually finish until the
|
| + // second test runs.
|
| + var firstTestCompleter = new Completer();
|
| +
|
| + group("group", () {
|
| + tearDown(tearDownBody);
|
| +
|
| + test("first test", () async {
|
| + print("running first test");
|
| + await firstTestCompleter.future;
|
| + firstTestFinished = true;
|
| + }, timeout: new Timeout(Duration.ZERO));
|
| + });
|
| +
|
| + test("second test", () {
|
| + print("running second test");
|
| + secondTestStarted = true;
|
| + firstTestCompleter.complete();
|
| + });
|
| + });
|
| +
|
| + expect(engine.run(), completes);
|
| + });
|
| +
|
| group("for a skipped test", () {
|
| test("doesn't run the test's body", () async {
|
| var bodyRun = false;
|
|
|