Support for direct requireJs dependency #99
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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