| 
View
 

QUnit-CLI-Integration

This version was saved 14 years, 9 months ago View current version     Page history
Saved by Jörn Zaefferer
on July 24, 2011 at 11:12:14 pm
 

There are currently two branches for CLI integration, one covering node.js and Rhino, one covering PhantomJS. As such they aren't very useful. They need to be merged to master and published in an appropiate format, e.g. as npm module for node, Narwhal for Rhino?.

 

PhantomJS

PhantomJS is pretty useful to run QUnit tests that target a browser environment in a continuos integration setup. The recent 1.2.0 release broke the existing runner due to heavy API changes, but there's a ticket to get that fixed.

 

node.js/npm

For distribution via npm, the package.json file needs a version property, and likely some other updates. In order to write tests with QUnit on node.js, there's some more going on that needs to be explored.

An interesting idea would be to reuse the browser-based testrunner, as an output for running node.js tests. QUnit would have to include a simple webserver that outputs the testresults in its usual markup and loads qunit.css to style it.

 

There are already plenty of testing modules for node.js, among them:

  • node-qunit, a port of QUnit
  • foounit, targets more then just node.js, e.g. browsers 
  • jasmine-node, node module for jasmine integration 
  • node-async-testing, focus on async tests, also an important QUnit feature 
  • nodeunit, a more popular node unit testing framework, tests are defined as exports 

 

Usefulness?

Currently its not quite clear how useful CLI integration actually is. PhantomJS can be used to run tests written for a browser, while node.js integration would be more about testing serverside code. That's clearly not a strength of QUnit right now, and probably will never be, especially considering all the specialized frameworks already available in that context. Instead QUnit should probably focus on integration scenarios that are relevant in the browser, such as better event simulation or interactions with canvas or SVG.  

Comments (0)

You don't have permission to comment on this page.