Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit cdcb35f

Browse files
committed
feat(tests): Only allow unittests to run in checked mode.
1 parent af7151e commit cdcb35f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

test/_specs.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Expect {
6464
toContain(expected) => unit.expect(actual, unit.contains(expected));
6565
toBe(expected) => unit.expect(actual,
6666
unit.predicate((actual) => identical(expected, actual), '$expected'));
67-
toThrow(exception) => unit.expect(actual, unit.throwsA(unit.contains(exception)));
67+
toThrow([exception]) => unit.expect(actual, exception == null ? unit.throws : unit.throwsA(unit.contains(exception)));
6868
toBeFalsy() => unit.expect(actual, (v) => v == null ? true : v is bool ? v == false : !(v is Object));
6969
toBeTruthy() => unit.expect(actual, (v) => v is bool ? v == true : v is Object);
7070
toBeDefined() => unit.expect(actual, (v) => v is Object);

test/angular_spec.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import '_specs.dart';
22

33
main() {
4+
describe('angular.dart unittests', () {
5+
it('should run in checked moded only', () {
6+
expect(() {
7+
String s = 6;
8+
}).toThrow();
9+
});
10+
});
11+
412
describe('relaxFnApply', () {
513
it('should work with 6 arguments', () {
614
var sixArgs = [1, 1, 2, 3, 5, 8];

0 commit comments

Comments
 (0)