diff options
| author | Igor Minar | 2013-08-24 14:18:47 -0700 |
|---|---|---|
| committer | Igor Minar | 2013-08-25 14:46:54 -0700 |
| commit | cbf06a5d64aba537f0e2679a194d3998d8365493 (patch) | |
| tree | 12e1b776021bbba6a96e276e3754582cf11ef6e5 /test/ng/timeoutSpec.js | |
| parent | 92700509c8eb0015d864efdc8a46b421a6256d03 (diff) | |
| download | angular.js-cbf06a5d64aba537f0e2679a194d3998d8365493.tar.bz2 | |
feat(mocks): make $timeout#flush throw an exception when empty
When calling $timeout.flush with or without a delay an exception should
be thrown if there is nothing to be flushed.
This prevents tests from flushing stuff unnecessarily.
BREAKING CHANGE: calling $timeout.flush(delay) when there is no task to be flushed
within the delay throws an exception now.
Please adjust the delay or remove the flush call from your tests as the exception
is a signed of a programming error.
Diffstat (limited to 'test/ng/timeoutSpec.js')
| -rw-r--r-- | test/ng/timeoutSpec.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ng/timeoutSpec.js b/test/ng/timeoutSpec.js index 832528e9..e4a2bc39 100644 --- a/test/ng/timeoutSpec.js +++ b/test/ng/timeoutSpec.js @@ -14,7 +14,7 @@ describe('$timeout', function() { $browser.defer.flush(); expect(counter).toBe(1); - expect(function() {$browser.defer.flush();}).toThrow('No deferred tasks to be flushed'); + expect(function() {$browser.defer.flush();}).toThrow('No deferred tasks to be flushed!'); expect(counter).toBe(1); })); |
