Skip to content
Snippets Groups Projects
Commit bc10ce6f authored by Natalie Weizenbaum's avatar Natalie Weizenbaum Committed by GitHub
Browse files

Fix onPlatform when used on a group(). (#613)

Closes #578
parent 68ded306
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
* `throwsA()` and all related matchers will now match functions that return * `throwsA()` and all related matchers will now match functions that return
`Future`s that emit exceptions. `Future`s that emit exceptions.
* Respect `onPlatform` for groups.
## 0.12.20+13 ## 0.12.20+13
* Upgrade to package:matcher 0.12.1 * Upgrade to package:matcher 0.12.1
......
...@@ -196,7 +196,11 @@ void group(description, body(), ...@@ -196,7 +196,11 @@ void group(description, body(),
tags, tags,
Map<String, dynamic> onPlatform}) { Map<String, dynamic> onPlatform}) {
_declarer.group(description.toString(), body, _declarer.group(description.toString(), body,
testOn: testOn, timeout: timeout, skip: skip, tags: tags); testOn: testOn,
timeout: timeout,
skip: skip,
tags: tags,
onPlatform: onPlatform);
// Force dart2js not to inline this function. We need it to be separate from // Force dart2js not to inline this function. We need it to be separate from
// `main()` in JS stack traces in order to properly determine the line and // `main()` in JS stack traces in order to properly determine the line and
......
...@@ -562,6 +562,30 @@ void main() { ...@@ -562,6 +562,30 @@ void main() {
test.stdout.expect(consumeThrough(contains("Skip: fifth"))); test.stdout.expect(consumeThrough(contains("Skip: fifth")));
test.shouldExit(0); test.shouldExit(0);
}); });
test("applies platforms to a group", () {
d
.file(
"test.dart",
'''
import 'dart:async';
import 'package:test/test.dart';
void main() {
group("group", () {
test("success", () {});
}, onPlatform: {
"vm": new Skip()
});
}
''')
.create();
var test = runTest(["test.dart"]);
test.stdout.expect(consumeThrough(contains("All tests skipped.")));
test.shouldExit(0);
});
}); });
group("with an @OnPlatform annotation", () { group("with an @OnPlatform annotation", () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment