-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
113 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: test | ||
version: 0.12.41 | ||
version: 0.12.42-dev | ||
author: Dart Team <[email protected]> | ||
description: A library for writing dart unit tests. | ||
homepage: https://github.com/dart-lang/test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file | ||
// 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. | ||
|
||
@TestOn("vm") | ||
import 'package:test_descriptor/test_descriptor.dart' as d; | ||
|
||
import 'package:test/test.dart'; | ||
|
||
import '../io.dart'; | ||
|
||
void main() { | ||
test("only runs the tests marked as solo", () async { | ||
await d.file("test.dart", """ | ||
import 'dart:async'; | ||
import 'package:test/test.dart'; | ||
void main() { | ||
test("passes", () { | ||
expect(true, isTrue); | ||
}, solo: true); | ||
test("failed", () { | ||
throw 'some error'; | ||
}); | ||
} | ||
""").create(); | ||
|
||
var test = await runTest(["test.dart"]); | ||
expect(test.stdout, emitsThrough(contains("+1: All tests passed!"))); | ||
await test.shouldExit(0); | ||
}); | ||
|
||
test("only runs groups marked as solo", () async { | ||
await d.file("test.dart", """ | ||
import 'dart:async'; | ||
import 'package:test/test.dart'; | ||
void main() { | ||
group('solo', () { | ||
test("first pass", () { | ||
expect(true, isTrue); | ||
}); | ||
test("second pass", () { | ||
expect(true, isTrue); | ||
}); | ||
}, solo: true); | ||
group('no solo', () { | ||
test("failure", () { | ||
throw 'some error'; | ||
}); | ||
test("another failure", () { | ||
throw 'some error'; | ||
}); | ||
}); | ||
} | ||
""").create(); | ||
|
||
var test = await runTest(["test.dart"]); | ||
expect(test.stdout, emitsThrough(contains("+2: All tests passed!"))); | ||
await test.shouldExit(0); | ||
}); | ||
} |