| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// Utilities for creating unit tests of Barback transformers. | 5 /// Utilities for creating unit tests of Barback transformers. |
| 6 library code_transformers.src.test_harness; | 6 library code_transformers.src.test_harness; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 | 9 |
| 10 import 'package:barback/barback.dart'; | 10 import 'package:barback/barback.dart'; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 return barback.results.first.then((_) { | 110 return barback.results.first.then((_) { |
| 111 if (files == null) return null; | 111 if (files == null) return null; |
| 112 var futures = []; | 112 var futures = []; |
| 113 files.forEach((k, v) { | 113 files.forEach((k, v) { |
| 114 futures.add(check(k, v)); | 114 futures.add(check(k, v)); |
| 115 }); | 115 }); |
| 116 return Future.wait(futures); | 116 return Future.wait(futures); |
| 117 }).then((_) { | 117 }).then((_) { |
| 118 // We only check messages when an expectation is provided. | 118 // We only check messages when an expectation is provided. |
| 119 if (messages == null) return; | 119 if (messages == null) return; |
| 120 expect(messages.length, messagesSeen, | 120 expect(messagesSeen, messages.length, |
| 121 reason: 'less messages than expected'); | 121 reason: 'less messages than expected'); |
| 122 }); | 122 }); |
| 123 } | 123 } |
| 124 } | 124 } |
| OLD | NEW |