var root = null;

if (typeof window === 'undefined') {
  root = global;
  root.tryc = require('../../');
} else {
  root = window;
  root.tryc = require('tryc');
  root.__karma__.start = function() {
    root.__karma__.info({ total: 1 });
    root.__karma__.result({ success: true });
    root.__karma__.complete();
  };
}

root.assert = function(expr, msg) {
  if (expr) return;
  throw Error(msg || 'Assertion failed');
};

root.test = function(str, fn) {
  var timeout = setTimeout(function() {
    throw new Error(str + ' timeout');
  }, 1000);

  fn(function() {
    clearTimeout(timeout);
  });
};

@@ -9,16 +9,54 @@
  = null;
+%0Avar completed = null;%0Avar tests = %5B%5D;
 %0A%0Aif (ty
@@ -136,16 +136,44 @@
 /../');%0A
+  completed = function()%7B%7D;%0A
 %7D else %7B
@@ -252,24 +252,54 @@
 = function()
+ %7B%7D;%0A%0A  completed = function()
  %7B%0A    root.
@@ -547,16 +547,156 @@
 , fn) %7B%0A
+  tests.push(%7B title: str, fn: fn %7D);%0A%7D;%0A%0AsetTimeout(function runNextTest() %7B%0A  var test = tests.shift();%0A  if (!test) return completed();%0A%0A
   var ti
@@ -747,19 +747,26 @@
 w Error(
-str
+test.title
  + ' tim
@@ -788,16 +788,21 @@
 00);%0A%0A  
+test.
 fn(funct
@@ -840,13 +840,36 @@
 t);%0A
+    runNextTest();%0A
   %7D);%0A%7D
+, 1)
 ;%0A

Fix issues with the custom test runner