kof/node-qunit — pull request #99 by luckysw (2014-09-03 12:47:03+00:00)
Title: Support for direct requireJs dependency

Hi,
It would be a pleasure if you can review and discuss the proposed change.
Basically I've found that with the current API it is not possible to add "module" dependency to the QUnit runner. All the names passed in opts.deps will be parsed as JS filename and prepended with its full path.

However this makes impossible to add a node.js/requireJs module dependency to the runner.
I've tried adding a new opts.moduleDeps field that will not be parsed as javascript source file, but simply passed as-is to the _require function running in the child process.

Doing that it seems possible to declare module dependency. We are using it in order to load the "qunit-reporter-junit" module to obtain a valid XML result file in our Jenkins environment.

Could you please review it? I don't like much the double 'deps / moduleDeps' parameter but I cannot find something better at the moment.

In addition, I've made a couple of changes to support run without a valid "code" field. This can happen if, for example, the Typescript compiler is used to compile both QUnit tests and code: in that case we will obtain a single .js file that contains the library to test and the test cases.
So basically with this fix we are able to test Typescript test case with QUnit directly using nodeJs as engine and Jenkins as agent.

Thank you,
Luciano