Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 23 lines (21 sloc) 0.508 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
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)
Something went wrong with that request. Please try again.