   # Close the tooltip when the user presses ESC.
   up.magic.onEscape(-> close())
 
+  # The framework is reset between tests
+  up.on 'up:framework:reset', reset
+
   attach: attach
   close: close
   open: -> u.error('up.tooltip.open no longer exists. Use up.tooltip.attach instead.')

up.tooltip = (($) ->
  
  u = up.util

  setPosition = ($link, $tooltip, position) ->
    linkBox = u.measure($link)

  close = (options) ->
    $tooltip = $('.up-tooltip')
    if $tooltip.length
      options = u.options(options, animation: config.closeAnimation)
      options = u.merge(options, up.motion.animateOptions(options))
      up.destroy($tooltip, options)

