Commit 90bec9fa 90bec9fa178dedd7f9223c274ac47715587c58c3 by Nicolas Perriault

fixed tests, jshint

1 parent 6e35765f
......@@ -5,3 +5,4 @@ modules/querystring.js
samples
tests/site
tests/testdir
tmp
......
......@@ -36,6 +36,7 @@ var utils = require('utils');
var f = utils.format;
function AssertionError(msg, result) {
"use strict";
Error.call(this);
this.message = msg;
this.name = 'AssertionError';
......@@ -829,7 +830,7 @@ Tester.prototype.done = function done(planned) {
if (arguments.length > 0) {
this.casper.warn('done() `planned` arg is deprecated as of 1.1');
}
if (this.currentSuite.planned && this.currentSuite.planned !== this.executed) {
if (this.currentSuite && this.currentSuite.planned !== this.executed) {
this.dubious(this.currentSuite.planned, this.executed);
} else if (planned && planned !== this.executed) {
this.dubious(planned, this.executed);
......@@ -1393,6 +1394,7 @@ TestCaseResult.prototype.addSuccess = function addSuccess(success, time) {
* @param Object warning
*/
TestCaseResult.prototype.addWarning = function addWarning(warning) {
"use strict";
warning.suite = this.name;
this.warnings.push(warning);
};
......
......@@ -216,7 +216,7 @@ function formatTestValue(value, name) {
} else if (name === 'stack') {
if (isArray(value)) {
formatted += value.map(function(entry) {
return format('in %s() in %s:%d', (entry.function || "anonymous"), entry.file, entry.line);
return format('in %s() in %s:%d', (entry['function'] || "anonymous"), entry.file, entry.line);
}).join('\n');
} else {
formatted += 'not provided';
......
......@@ -102,7 +102,7 @@ XUnitExporter.prototype.getXML = function getXML() {
tests: result.assertions,
failures: result.failures.length,
time: utils.ms2seconds(result.calculateDuration()),
'package': generateClassName(result.file),
'package': generateClassName(result.file)
});
result.passes.forEach(function(success) {
var testCase = utils.node('testcase', {
......
/*global casper*/
/*global casper __utils__*/
/*jshint strict:false*/
var tester = require('tester');
var testpage = require('webpage').create();
......