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

Unified Diff: test/backend/declarer_test.dart

Issue 1364893004: Run outer tearDown()s even if inner ones fail. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: More robust Created 5 years, 3 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
« lib/src/backend/group.dart ('K') | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/backend/declarer_test.dart
diff --git a/test/backend/declarer_test.dart b/test/backend/declarer_test.dart
index 4873b6151c9e23a7e031a981f6b3ed8abb50ebf1..381536724c53ad75c2eb169c5178d50df49a0e90 100644
--- a/test/backend/declarer_test.dart
+++ b/test/backend/declarer_test.dart
@@ -389,6 +389,26 @@ void main() {
expect(outerTearDownRun, isTrue);
});
+ test("runs outer callbacks even when inner ones fail", () async {
+ var outerTearDownRun = false;
+ _declarer.tearDown(() {
+ return new Future(() => outerTearDownRun = true);
+ });
+
+ _declarer.group("inner", () {
+ _declarer.tearDown(() {
+ throw 'inner error';
+ });
+
+ _declarer.test("description", expectAsync(() {
+ expect(outerTearDownRun, isFalse);
+ }, max: 1));
+ });
+
+ await _runTest(0, shouldFail: true);
+ expect(outerTearDownRun, isTrue);
+ });
+
test("can't be called multiple times", () {
_declarer.group("group", () {
_declarer.tearDown(() {});
« lib/src/backend/group.dart ('K') | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698