mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add jasmine.useRealClock
This is the only way to unmock the _.now function uses by _.debounce and _.throttle, since package specs don't necessarily have access to core's copy of underscore-plus Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
committed by
Nathan Sobo
parent
0b0cbe11dc
commit
d4cc549a01
@@ -213,6 +213,11 @@ jasmine.snapshotDeprecations = ->
|
||||
jasmine.restoreDeprecationsSnapshot = ->
|
||||
Grim.deprecations = deprecationsSnapshot
|
||||
|
||||
jasmine.useRealClock = ->
|
||||
jasmine.unspy(window, 'setTimeout')
|
||||
jasmine.unspy(window, 'clearTimeout')
|
||||
jasmine.unspy(_._, 'now')
|
||||
|
||||
addCustomMatchers = (spec) ->
|
||||
spec.addMatchers
|
||||
toBeInstanceOf: (expected) ->
|
||||
|
||||
Reference in New Issue
Block a user