Skip to content

Usage question #8

Description

@voidpp

I tried to use this stuff, but I failed.
In debian wheezy I installed the nodejs (v0.10.28), from the source, configure, make, make install, everything goes wonderful.
After I installed the qunit-cli by "npm install qunit-cli -g", and it still looked fine. (qunitjs@1.10.0)
Here is my very complex test

if (typeof QUnit == 'undefined') // if your tests also run in the browser...
    QUnit = require('qunit-cli');

// use QUnit as you normally would.

//module( "group a");

test("hello test", function() {
        ok( 1 == "1", "Passed!" );
});

If I try to running this by "qunit-cli mytests.js" the result is:

/usr/local/lib/node_modules/qunit-cli/index.js:44
            console.log('\n' + details.module.bold.blue);
                                             ^
TypeError: Cannot read property 'bold' of undefined
    at F.QUnit.done.msg (/usr/local/lib/node_modules/qunit-cli/index.js:44:46)
    at runLoggingCallbacks (/usr/local/lib/node_modules/qunit-cli/node_modules/qunitjs/qunit/qunit.js:1382:19)
    at Object.Test.finish (/usr/local/lib/node_modules/qunit-cli/node_modules/qunitjs/qunit/qunit.js:253:3)
    at /usr/local/lib/node_modules/qunit-cli/node_modules/qunitjs/qunit/qunit.js:285:10
    at process (/usr/local/lib/node_modules/qunit-cli/node_modules/qunitjs/qunit/qunit.js:1277:24)
    at null._onTimeout (/usr/local/lib/node_modules/qunit-cli/node_modules/qunitjs/qunit/qunit.js:383:5)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

because the "details.module" is undefined. Then I try to define a module with the module function as the qunit doc writes, but the result is:

/home/santa/devel/tests/mytests.js:6
module( "group a");
^
TypeError: object is not a function
    at Object.<anonymous> (/home/santa/devel/tests/mytests.js:6:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at /usr/local/lib/node_modules/qunit-cli/bin/qunit-cli:57:3
    at Array.forEach (native)
    at Object.<anonymous> (/usr/local/lib/node_modules/qunit-cli/bin/qunit-cli:56:7)

I tried to look for solution for this problem, but not found anything, and I don't know what is the problem...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions