Permalink
Browse files

fixes for NO coverage support

  • Loading branch information...
zzo committed Nov 21, 2011
1 parent 3e16c13 commit 28e01cc24e57cddcba39de163d0bbaed3661f4e1
Showing with 8 additions and 15 deletions.
  1. +2 −2 backend/nodejute/jute/jute_docs/jute.js
  2. +5 −12 backend/nodejute/jute/server.js
  3. +1 −1 backend/nodejute/package.json
@@ -179,8 +179,8 @@ YUI().add('jute', function(Y) {
test = data.availableTests[i];
content += '<tr>';
content += '<td>' + test.test_url + '</td>';
- content += '<td align="center"><input name="test" class="no_cov_cbox" type="checkbox" value="' + test.test_url + '" />&nbsp;<a href="/' + data.config.testDirWeb + test.test_url + '?_one_shot=1">Run</a></td>';
- content += '<td align="center"><input name="test" class="cov_cbox" type="checkbox" value="' + test.test_url + '?do_coverage=1" /><a href="/' + data.config.testDirWeb + test.test_url + '?_one_shot=1&do_coverage=1">Run</a></td>';
+ content += '<td align="center"><input name="test" class="no_cov_cbox" type="checkbox" value="' + test.test_url + '?do_coverage=0" />&nbsp;<a href="/' + data.config.testDirWeb + test.test_url + '?do_coverage=0&_one_shot=1">Run</a></td>';
+ content += '<td align="center"><input name="test" class="cov_cbox" type="checkbox" value="' + test.test_url + '" /><a href="/' + data.config.testDirWeb + test.test_url + '?_one_shot=1">Run</a></td>';
content += '</tr>';
}
content += '</table>';
@@ -117,18 +117,11 @@ Create: function(hub) {
try { fs.statSync(path); } catch(e) { res.writeHeader(404); res.end('Cannot find: ' + path ); return; } // 404 this bad boy
- /*
- if (req.query._one_shot && path.match(/\.js$/)) {
- // A V8 test!!
- exec('JUTE_DEBUG=1 ' + p.join(__dirname, '..', 'jute_v8.js') + ' ' + url + '?do_coverage=' + req.query.do_coverage, function(error, stdout, stderr) {
- if (error) {
- res.end('V8 ERROR: ' + error);
- } else {
- res.end(stdout);
- }
- });
- } else */
- if (req.query.coverage) { // && (!req.headers.referer || req.headers.referer.match('do_coverage=1'))) {
+ // Do coverage for this file IF:
+ // 1. coverage requested
+ // 2a. referrer header does not exist
+ // 2b. OR referrer header ODES NOT HAVE 'do_coverage=0' in its query string
+ if (req.query.coverage && req.headers.referer && !req.headers.referer.match('do_coverage=0')) {
// Coverage this bad boy!
var tempFile = p.join('/tmp', p.basename(path));
hub.emit(hub.LOG, hub.INFO, "Generating coverage file " + tempFile + " for " + path);
@@ -2,7 +2,7 @@
"name": "jute",
"description": "Javascript Unit Test Environment",
"keywords": ["selenium", "test", "testing", "unit", "tests"],
- "version": "0.0.56",
+ "version": "0.0.57",
"author": "Mark Ethan Trostler <mark@zzo.com>",
"preferGlobal": true,
"bin" : {

0 comments on commit 28e01cc

Please sign in to comment.