Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for setting module from commandline #74

Closed
alxndrsn opened this issue Jan 29, 2013 · 2 comments
Closed

Add support for setting module from commandline #74

alxndrsn opened this issue Jan 29, 2013 · 2 comments
Labels

Comments

@alxndrsn
Copy link

Hi, I find this library very useful for running javascript unit tests. However, I had to do some ugly stuff to get it working for my situation:

To run all tests in specific directory against corresponding JS files:

https://github.com/frontlinesms/frontlinesms2/blob/master/plugins/frontlinesms-core/do/js_unit_test

To parse output of node-qunit and convert it to JUnit XML reports (for use with Jenkins):

https://github.com/frontlinesms/frontlinesms2/blob/master/plugins/frontlinesms-core/do/js_unit_test_xml

One thing that would make life easier in my situation would be to be able to set the equivalent of QUnit.module("some-module-name") as a commandline arg, e.g.

qunit -t mytest.js -m mytest

where -m <somename> sets the module name

Anyway, thanks for a great lib and let me know if I'm missing anything obvious.

@kof
Copy link
Contributor

kof commented Jan 29, 2013

  1. Well, there are a lot of strategies for structuring files, it depends on the architecture of a product, I don't want to force someone using one of them, therefor one will need either to write a files finder or reference them manually in some config file. It is possible to make this less ugly f.e. by using node-qunit js api directly without cli. Write your own bin/testrunner.js script and pass the files from there. Also you can use some high level nodejs modules to find your files.
  2. make output TAP conform #17 add way to load qunit addons such as qunit/addons/junitlogger/junitlogger.js #73 issues are about export.
  3. Why do you want to set the module name from outside of the module. Normally your module should know its name or it will be auto detected using file name.
@alxndrsn
Copy link
Author

Hi kof, your suggestion to write a JS file finder sounds like the neatest way to solve this. Thanks for the feedback.

@kof kof closed this as completed Jan 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants