mirror of
https://github.com/scratchfoundation/jquery-timeago.git
synced 2024-11-23 07:47:54 -05:00
23 lines
508 B
CoffeeScript
23 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)
|