fix race in QUnit web test (#899)
authorAlex Lam S.L <alexlamsl@gmail.com>
Thu, 29 Mar 2018 07:03:25 +0000 (16:03 +0900)
committerGitHub <noreply@github.com>
Thu, 29 Mar 2018 07:03:25 +0000 (16:03 +0900)
test.js
tests/minifier.js

diff --git a/test.js b/test.js
index e6c03fe..e41b0b0 100644 (file)
--- a/test.js
+++ b/test.js
@@ -23,13 +23,13 @@ function hook() {
     details.failures = failures;
     alert(JSON.stringify(details));
   });
+  QUnit.start();
 }
 
 if (typeof phantom === 'undefined') {
   load('./src/htmlminifier');
-  hook();
   require(process.argv[2]);
-  QUnit.load();
+  hook();
 }
 else {
   var system = require('system');
index 5a3b837..f6946a5 100644 (file)
@@ -1,6 +1,7 @@
 /* global minify */
 'use strict';
 
+QUnit.config.autostart = false;
 if (typeof minify === 'undefined') {
   self.minify = require('html-minifier').minify;
 }