UNPKG

can-route-hash

Version:

[![Join our Slack](https://img.shields.io/badge/slack-join%20chat-611f69.svg)](https://www.bitovi.com/community/slack?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join our Discourse](https://img.shields.io/discourse/https/

29 lines (23 loc) 604 B
var helpers = {}; helpers.setup = function(callback, assert){ var done = assert.async(); var testarea = document.getElementById('qunit-fixture'); var iframe = document.createElement('iframe'); window.routeTestReady = function(){ callback.apply(iframe, arguments); }; iframe.src = __dirname + "/testing.html?"+Math.random(); testarea.appendChild(iframe); helpers.teardown = function(){ setTimeout(function() { testarea.removeChild(iframe); setTimeout(function() { done(); }, 10); }, 1); }; return function(){ return helpers.teardown(); }; }; module.exports = helpers;