title: Testing using JsTestDriver + RequireJS + QUnit
body: <p>After much searching and quite a bit of trial it seems to me that the chosen combination of
  tools just doesn't have it. I would LOVE to be mistaken.</p>
  
  <p>Well, the technological stack is as mentioned in the title. To expand, </p>
  
  <ol>
  <li>Backbone for all "classes"</li>
  <li>RequireJS to load and manage dependencies between Backbone entities</li>
  <li>QUnit (where tests are also RequireJS modules)</li>
  <li>JsTestDriver for command line automation</li>
  </ol>
  
  <p><strong>Setup and code snippets</strong></p>
  
  <p><em>jsTestDriver.conf</em></p>
  
  <pre><code>server: http://localhost:48080
  basepath: path/to/JSTestDriver/
  load:
    - lib/qunit/qunit-1.10.0.js
    - lib/qunit/equiv.js
    - lib/qunit/QUnitAdapter.js
    - lib/requirejs/require.js
  test:
    - test/tests.js
  serve:
    - lib/jquery/jquery-1.7.1.js
    - test/components/ComponentOneTest.js
  </code></pre>
  
  <p><em>tests.js</em></p>
  
  <pre><code>require({  
      baseUrl : '/test',
      shim : {
          'fixture.object' : ['jquery'],
          'fixture.string' : ['jquery'],
          'fixture.dom' : ['jquery', 'fixture.string'],
          'fixtures' : ['fixture.object', 'fixture.string', 'fixture.dom'],
          'equiv' : ['qunit'],
          'qunit.adapter' : ['qunit', 'equiv']
      },
      paths: {  
          'text' : 'lib/requirejs/text',
          'jquery' : 'lib/jquery/jquery-1.7.1',
          'backbone' : 'lib/backbone/amd/backbone',
          'underscore' : 'lib/underscore/amd/underscore',
          'fixture.dom' : 'lib/fixture/jquery.dom.fixture',
          'fixture.string' : 'lib/fixture/jquery.lang.string',
          'fixture.object' : 'lib/fixture/jquery.lang.object',
          'fixtures' : 'fixture/fixtures',
          'qunit' : 'lib/qunit/qunit-1.10.0',
          'equiv' : 'lib/qunit/equiv',
          'qunit.adapter' : 'lib/qunit/QUnitAdapter'
      }
  }, [], function() {
      module('Module 1', {});
  
      test('test 1', 1, function() {
          ok(true, 'passed');
      });
  
      asyncTest('test 2', 1, function() {
          start();
          ok(true, 'passed');
  
      });
  });
  </code></pre>
  
  <p><em>Server starting command (from the same directory JSTD JAR is in)</em></p>
  
  <pre><code>java -jar JsTestDriver-1.3.4.b.jar --port 48080
  </code></pre>
  
  <p><em>Tests running command (from the same directory JSTD JAR is in)</em></p>
  
  <pre><code>java -jar JsTestDriver-1.3.4.b.jar --runnerMode PROFILE --reset --dryRunFor all --tests all
  </code></pre>
  
  <p><strong>What works?</strong></p>
  
  <p>The first, synchronous, test does.</p>
  
  <p><strong>What doesn't work?</strong></p>
  
  <p>The second, asynchronous test doesn't work and times out.</p>
  
  <p><strong>The error</strong></p>
  
  <p><em>Chrome console</em></p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'all' of undefined qunit-1.10.0.js:1102
  done qunit-1.10.0.js:1102
  process qunit-1.10.0.js:1285
  (anonymous function) qunit-1.10.0.js:383
  </code></pre>
  
  <p><em>Console</em></p>
  
  <pre><code>setting runnermode PROFILE
  Chrome: Reset
  Chrome: Reset
  Chrome 22.0.1229.64: 1 tests [
  Module 1 (/test/test/tests.js)
          test test 1
          test test 2]
  .F
  Total 2 tests (Passed: 1; Fails: 1; Errors: 0) (30025.00 ms)
    Chrome 22.0.1229.64 Windows: Run 2 tests (Passed: 1; Fails: 1; Errors 0) (30025.00 ms)
      Module 1.test test 2 failed (30023.00 ms): Error: Callback '#1' expired after 30000 ms during test step 'start()'
        Error: Callback '#1' expired after 30000 ms during test step 'start()'
  
  Sep 23, 2012 8:36:44 PM com.google.jstestdriver.ActionRunner runActions
  INFO:
  </code></pre>
  
  <p><strong>Notes</strong></p>
  
  <p>I did download the latest QUnit adapter from <a href="https://github.com/exnor/QUnit-to-JsTestDriver-adapter" rel="nofollow">here</a>. I also tried a bunch of other, supposedly working, adapters to no avail.</p>
  
  <p><strong>Question</strong></p>
  
  <p>Is this even possible? If so, would someone be so kind to shed some light on the issue?</p>
  
  <p>Thank you.</p>
  
  <p><strong>UPDATE (08.04.14)</strong>:</p>
  
  <p><a href="http://karma-runner.github.io/0.12/index.html" rel="nofollow">Karma</a>. That is all.</p>