fix known issues on Node.js 0.11 (#555)

This commit is contained in:
Jeff Williams 2013-12-26 10:15:03 -08:00
parent db737e75ff
commit 41ccdf832e
3 changed files with 7 additions and 6 deletions

View File

@ -133,7 +133,7 @@ function wrapLogFunction(name, func) {
function printToStdout() {
var args = Array.prototype.slice.call(arguments, 0);
util.print( util.format.apply(util, args) );
process.stdout.write( util.format.apply(util, args) );
}
/**

View File

@ -50,7 +50,6 @@ jasmine.initialize = function(done, verbose) {
}
var reporterOpts = {
print: util.print,
color: env.opts.nocolor === true ? false : true,
onComplete: done
};

View File

@ -1,4 +1,6 @@
module.exports = function(jasmine) {
var util = require('util');
var jasmineNode = {};
//
@ -32,7 +34,7 @@ module.exports = function(jasmine) {
};
jasmineNode.TerminalReporter = function(config) {
this.print_ = config.print || print;
this.print_ = config.print || function (str) { process.stdout.write(util.format(str)); };
this.color_ = config.color ? jasmineNode.ANSIColors : jasmineNode.NoColors;
this.started_ = false;
@ -152,10 +154,10 @@ module.exports = function(jasmine) {
reportSpecResults : function(spec) {
var result = spec.results();
var msg = '';
if (result.passed()) {
if (result.skipped) {
msg = this.stringWithColor_('-', this.color_.ignore());
} else if (result.passed()) {
msg = this.stringWithColor_('.', this.color_.pass());
// } else if (result.skipped) { TODO: Research why "result.skipped" returns false when "xit" is called on a spec?
// msg = (colors) ? (ansi.yellow + '*' + ansi.none) : '*';
} else {
msg = this.stringWithColor_('F', this.color_.fail());
this.addFailureToFailures_(spec);