diff --git a/lib/js/test/test-jq.js b/lib/js/test/test-jq.js
index d8649a0..f62bb95 100644
--- a/lib/js/test/test-jq.js
+++ b/lib/js/test/test-jq.js
@@ -33,19 +33,18 @@
 //////////////////////////////////
 //jQuery asynchronous tests
 jQuery.ajaxSetup({ timeout: 0 });
-$(document).ajaxError(function() { QUnit.start(); });
 
-module('jQ Async Manual');
+QUnit.module('jQ Async Manual');
 
-  test('testI32', function() {
-    expect(2);
-    QUnit.stop();
+  QUnit.test('testI32', function(assert) {
+    assert.expect(2);
+    const done = assert.async(2);
 
-    var transport = new Thrift.Transport();
-    var protocol = new Thrift.Protocol(transport);
-    var client = new ThriftTest.ThriftTestClient(protocol);
+    const transport = new Thrift.Transport();
+    const protocol = new Thrift.Protocol(transport);
+    const client = new ThriftTest.ThriftTestClient(protocol);
 
-    var jqxhr = jQuery.ajax({
+    const jqxhr = jQuery.ajax({
       url: '/service',
       data: client.send_testI32(Math.pow(-2, 31)),
       type: 'POST',
@@ -53,23 +52,24 @@
       dataType: 'text',
       success: function(res) {
         transport.setRecvBuffer(res);
-        equal(client.recv_testI32(), Math.pow(-2, 31));
+        assert.equal(client.recv_testI32(), Math.pow(-2, 31));
+        done();
       },
-      error: function() { ok(false); },
+      error: function() { assert.ok(false); },
       complete: function() {
-        ok(true);
-        QUnit.start();
+        assert.ok(true);
+        done();
       }
     });
   });
 
-  test('testI64', function() {
-    expect(2);
-    QUnit.stop();
+  QUnit.test('testI64', function(assert) {
+    assert.expect(2);
+    const done = assert.async(2);
 
-    var transport = new Thrift.Transport();
-    var protocol = new Thrift.Protocol(transport);
-    var client = new ThriftTest.ThriftTestClient(protocol);
+    const transport = new Thrift.Transport();
+    const protocol = new Thrift.Protocol(transport);
+    const client = new ThriftTest.ThriftTestClient(protocol);
 
     jQuery.ajax({
       url: '/service',
@@ -81,78 +81,79 @@
       success: function(res) {
         transport.setRecvBuffer(res);
         //This is usually 2^61 but JS cannot represent anything over 2^52 accurately
-        equal(client.recv_testI64(), Math.pow(-2, 52));
+        assert.equal(client.recv_testI64(), Math.pow(-2, 52));
+        done();
       },
-      error: function() { ok(false); },
+      error: function() { assert.ok(false); },
       complete: function() {
-        ok(true);
-        QUnit.start();
+        assert.ok(true);
+        done();
       }
     });
   });
 
 
-module('jQ Async');
-  test('I32', function() {
-    expect(3);
+QUnit.module('jQ Async');
+  QUnit.test('I32', function(assert) {
+    assert.expect(3);
 
-    QUnit.stop();
+    const done = assert.async(3);
     client.testI32(Math.pow(2, 30), function(result) {
-      equal(result, Math.pow(2, 30));
-      QUnit.start();
+      assert.equal(result, Math.pow(2, 30));
+      done();
     });
 
-    QUnit.stop();
-    var jqxhr = client.testI32(Math.pow(-2, 31), function(result) {
-      equal(result, Math.pow(-2, 31));
+    const jqxhr = client.testI32(Math.pow(-2, 31), function(result) {
+      assert.equal(result, Math.pow(-2, 31));
+      done();
     });
 
     jqxhr.success(function(result) {
-      equal(result, Math.pow(-2, 31));
-      QUnit.start();
+      assert.equal(result, Math.pow(-2, 31));
+      done();
     });
   });
 
-  test('I64', function() {
-    expect(4);
+  QUnit.test('I64', function(assert) {
+    assert.expect(4);
 
-    QUnit.stop();
+    const done = assert.async(4);
     //This is usually 2^60 but JS cannot represent anything over 2^52 accurately
     client.testI64(Math.pow(2, 52), function(result) {
-      equal(result, Math.pow(2, 52));
-      QUnit.start();
+      assert.equal(result, Math.pow(2, 52));
+      done();
     });
 
-    QUnit.stop();
     //This is usually 2^60 but JS cannot represent anything over 2^52 accurately
     client.testI64(Math.pow(-2, 52), function(result) {
-      equal(result, Math.pow(-2, 52));
+      assert.equal(result, Math.pow(-2, 52));
+      done();
     })
-    .error(function(xhr, status, e) { ok(false, e.message); })
+    .error(function(xhr, status, e) { assert.ok(false, e.message); })
     .success(function(result) {
       //This is usually 2^60 but JS cannot represent anything over 2^52 accurately
-      equal(result, Math.pow(-2, 52));
+      assert.equal(result, Math.pow(-2, 52));
+      done();
     })
     .complete(function() {
-      ok(true);
-      QUnit.start();
+      assert.ok(true);
+      done();
     });
   });
 
-  test('Xception', function() {
-    expect(2);
+  QUnit.test('Xception', function(assert) {
+    assert.expect(2);
 
-    QUnit.stop();
+    const done = assert.async(2);
 
-    var dfd = client.testException('Xception', function(result) {
-      ok(false);
-      QUnit.start();
+    const dfd = client.testException('Xception', function(result) {
+      assert.ok(false);
+      done();
     })
     .error(function(xhr, status, e) {
-      equal(e.errorCode, 1001);
-      equal(e.message, 'Xception');
-      //QUnit.start();
-      //Note start is not required here because:
-      //$(document).ajaxError( function() { QUnit.start(); } );
+      assert.equal(e.errorCode, 1001);
+      assert.equal(e.message, 'Xception');
+      done();
+      $(document).ajaxError( function() { done(); } );
     });
   });
