mirror of
https://github.com/scratchfoundation/jquery-timeago.git
synced 2024-11-27 09:45:38 -05:00
24 lines
508 B
CoffeeScript
24 lines
508 B
CoffeeScript
|
setupFn = -> null
|
||
|
window.setup = (fn) ->
|
||
|
setupFn = fn
|
||
|
window.moreSetup = (fn) ->
|
||
|
origSetup = setupFn
|
||
|
setup ->
|
||
|
origSetup.call(this)
|
||
|
fn.call(this)
|
||
|
window.clearSetup = ->
|
||
|
setup -> null
|
||
|
|
||
|
originalModule = window.module
|
||
|
window.module = (description) ->
|
||
|
clearSetup()
|
||
|
originalModule(description)
|
||
|
|
||
|
originalTest = window.test
|
||
|
window.test = (description, testFn) ->
|
||
|
setupSnapshot = setupFn
|
||
|
originalTest description, ->
|
||
|
context = {}
|
||
|
setupSnapshot.call(context)
|
||
|
testFn.call(context)
|