diff --git a/test/_specs.dart b/test/_specs.dart index ccebdcd0e..a15eb603c 100644 --- a/test/_specs.dart +++ b/test/_specs.dart @@ -64,7 +64,7 @@ class Expect { toContain(expected) => unit.expect(actual, unit.contains(expected)); toBe(expected) => unit.expect(actual, unit.predicate((actual) => identical(expected, actual), '$expected')); - toThrow(exception) => unit.expect(actual, unit.throwsA(unit.contains(exception))); + toThrow([exception]) => unit.expect(actual, exception == null ? unit.throws : unit.throwsA(unit.contains(exception))); toBeFalsy() => unit.expect(actual, (v) => v == null ? true : v is bool ? v == false : !(v is Object)); toBeTruthy() => unit.expect(actual, (v) => v is bool ? v == true : v is Object); toBeDefined() => unit.expect(actual, (v) => v is Object); diff --git a/test/angular_spec.dart b/test/angular_spec.dart index 37416e96b..bcf0217dc 100644 --- a/test/angular_spec.dart +++ b/test/angular_spec.dart @@ -1,6 +1,14 @@ import '_specs.dart'; main() { + describe('angular.dart unittests', () { + it('should run in checked moded only', () { + expect(() { + String s = 6; + }).toThrow(); + }); + }); + describe('relaxFnApply', () { it('should work with 6 arguments', () { var sixArgs = [1, 1, 2, 3, 5, 8];