qunitjs / node-qunit

QUnit runner for Node.js.
MIT License
172 stars 53 forks source link

Tests not completing #104

Closed poleveD closed 10 years ago

poleveD commented 10 years ago

I am trying to run qunits inside a node application. However the tests do not seem to complete and never prints the report to the console.

When I run the tests, I see this message Testing C:\root\app\uploads\source_code.js ...

I have added the below line of code to point to node-qunit module:

var testrunner  = require('../node_modules/qunit');

I have this code to run the tests against a source code (this is in tester.js):

  testrunner.run({
    code: "app/uploads/source_code.js",
    tests: "tests/tests.js"
  },function(err, report) {
      console.log(report);
  });

_sourcecode.js

function sayHello() {
  return "Hello";
}

tests.js

test( "Hello", function() {
  ok(true); 
});

My application structure is:

I am using the "latest" version of node-qunit and running node version 0.8.14 and express 4.x

Can you please let me know what is the issue here?

kof commented 10 years ago

except that you can use var testrunner = require('qunit'); I don't see what is wrong in your example.

poleveD commented 10 years ago

I did modify the require as suggested. I still see the same issue.

It seems that the testrunner does NOT exit the loop though I am not sure what the testrunner is waiting for.

kof commented 10 years ago

I don't see from your example what can be wrong.

kof commented 10 years ago

of course your code can't be tested because you don't export any api, but it doesn't matter

kof commented 10 years ago

please reopen the issue if you have more information

poleveD commented 10 years ago

Will do, at this time however it does not work :-(