This Question is Answered

2 "helpful" answers available (2 pts)
2 Replies Last post: Jun 9, 2014 10:49 PM by BobbinUpAndDown  
BobbinUpAndDown Newbie 28 posts since
Apr 10, 2010
Currently Being Moderated

Jun 7, 2014 12:11 PM

QUnit + JSTestDriver: No tests found

I'm not able to get QUnit working with the JSTestDriver plugin working in PHPStorm.  I have followed the help and guides online, but I will always get the error:

 

No tests found. Please check 'test:' section of the configuration file

Empty test suite

My jstestdriver.jstd configuration:

My jstestdriver.jstd file


load:
- test/libs/equiv.js
- test/libs/QUnitAdapter.js
- bower_components/jquery/dist/jquery.js
- bower_components/qunit/qunit/qunit.js
- src/*.js

test:
- test/*.js

My test file:


(function() {
  (function($) {

    /*
         ======== A Handy Little QUnit Reference ========
         http://api.qunitjs.com/
    
         Test methods:
         module(name, {[setup][ ,teardown]})
         test(name, callback)
         expect(numberOfAssertions)
         stop(increment)
         start(decrement)
         Test assertions:
         ok(value, [message])
         equal(actual, expected, [message])
         notEqual(actual, expected, [message])
         deepEqual(actual, expected, [message])
         notDeepEqual(actual, expected, [message])
         strictEqual(actual, expected, [message])
         notStrictEqual(actual, expected, [message])
         throws(block, [expected], [message])
     */
    "use strict";
    module("jQuery#hash-tabs", {
      setup: function() {
        return this.elems = $("#qunit-fixture").children();
      }
    });
    test("is chainable", function() {
      expect(1);
      return strictEqual(this.elems.hash - tabs(), this.elems, "should be chainable");
    });
    test("is hash-tabs", function() {
      expect(1);
      return strictEqual(this.elems.hash - tabs().text(), "hash-tabs0hash-tabs1hash-tabs2", "should be hash-tabs");
    });
    module("jQuery.hash-tabs");
    test("is hash-tabs", function() {
      expect(2);
      strictEqual($.hash - tabs(), "hash-tabs.", "should be hash-tabs");
      return strictEqual($.hash - tabs({
        punctuation: "!"
      }), "hash-tabs!", "should be thoroughly hash-tabs");
    });
    module(":hash-tabs selector", {
      setup: function() {
        return this.elems = $("#qunit-fixture").children();
      }
    });
    return test("is hash-tabs", function() {
      expect(1);
      return deepEqual(this.elems.filter(":hash-tabs").get(), this.elems.last().get(), "knows hash-tabs when it sees it");
    });
  })(jQuery);

}).call(this);

Tests will run fine using the web version and index.html file which ships with QUnit.  But tests cannot be found using the jstestdriver plugin.

 

Any help would be appreciated

Sergey Simonchik JetBrains 177 posts since
Sep 28, 2011
Currently Being Moderated
Jun 9, 2014 4:14 PM in response to: BobbinUpAndDown
Re: QUnit + JSTestDriver: No tests found

Thanks, reproduced. JsTestDriver plugin reported wrong error message.

Actually, when running the test in console (outside PHPStrorm), it reports:

Uncaught Error: Test case names must not contain '#'

So, the workaround is to rename "jQuery#hash-tabs" to something else.

The error message reporting will be improved in PHPStorm 9.

More Like This

  • Retrieving data ...