Permalink
Browse files

YUITest npm build

  • Loading branch information...
1 parent cc8f87a commit ddd63e54ba46d85fba812004a4b0c60c0af36815 @davglass davglass committed Apr 2, 2013
View
@@ -43,16 +43,7 @@ YUITest.CLI = {
},
quit: function(code){
-
- //Workaround for https://github.com/joyent/node/issues/1669
- var flushed = process.stdout.flush && process.stdout.flush();
- if (!flushed && (parseFloat(process.versions.node) < 0.5)) {
- process.once("drain", function () {
- process.exit(code || 0);
- });
- } else {
- process.exit(code || 0);
- }
+ process.exit(code || 0);
},
isDirectory: function(name) {
@@ -513,6 +504,9 @@ YUITest.Util.mix(YUITest.CLI, {
this.processArguments();
this.processFiles();
+ YUITest.TestRunner.subscribe(YUITest.TestRunner.COMPLETE_EVENT, function(event) {
+ YUITest.CLI.quit(event.results.failed ? 1 : 0);
+ });
YUITest.TestRunner.run({
groups: this.options.groups ? this.options.groups.split(",") : null
@@ -10,7 +10,7 @@
*/
var YUITest = exports;
-YUITest.version = "0.7.8";
+YUITest.version = "0.7.9";
//backwards compatibility
exports.YUITest = YUITest;
@@ -1995,7 +1995,7 @@ YUITest.Results = function(name){
* @property duration
*/
this.duration = 0;
-}
+};
/**
* Includes results from another results object into this one.
@@ -3451,12 +3451,19 @@ YUITest.CoverageFormat = {
* format is specified, a string representing the results in that format.
* @method getCoverage
*/
- getCoverage: function(format){
- if (!this._running && typeof _yuitest_coverage == "object"){
- if (typeof format == "function"){
- return format(_yuitest_coverage);
+ getCoverage: function(format) {
+ var covObject = null;
+ if (typeof _yuitest_coverage === "object") {
+ covObject = _yuitest_coverage;
+ }
+ if (typeof __coverage__ === "object") {
+ covObject = __coverage__;
+ }
+ if (!this._running && typeof covObject == "object"){
+ if (typeof format == "function") {
+ return format(covObject);
} else {
- return _yuitest_coverage;
+ return covObject;
}
} else {
return null;
@@ -1,6 +1,6 @@
{
"name": "yuitest",
- "version": "0.7.8",
+ "version": "0.7.9",
"description": "YUI Test Library on NodeJS",
"author": "Dav Glass <davglass@gmail.com>",
"url": { "web" : "http://yuilibrary.com/projects/yuitest/issues" },
@@ -10,7 +10,7 @@
*/
var YUITest = {
- version: "0.7.8",
+ version: "0.7.9",
_idx: 0,
guid: function(pre) {
var id = (new Date()).getTime() + '_' + (++YUITest._idx);
@@ -1992,7 +1992,7 @@ YUITest.Results = function(name){
* @property duration
*/
this.duration = 0;
-}
+};
/**
* Includes results from another results object into this one.
@@ -3448,12 +3448,19 @@ YUITest.CoverageFormat = {
* format is specified, a string representing the results in that format.
* @method getCoverage
*/
- getCoverage: function(format){
- if (!this._running && typeof _yuitest_coverage == "object"){
- if (typeof format == "function"){
- return format(_yuitest_coverage);
+ getCoverage: function(format) {
+ var covObject = null;
+ if (typeof _yuitest_coverage === "object") {
+ covObject = _yuitest_coverage;
+ }
+ if (typeof __coverage__ === "object") {
+ covObject = __coverage__;
+ }
+ if (!this._running && typeof covObject == "object"){
+ if (typeof format == "function") {
+ return format(covObject);
} else {
- return _yuitest_coverage;
+ return covObject;
}
} else {
return null;
Oops, something went wrong.
@@ -10,7 +10,7 @@
*/
var YUITest = {
- version: "0.7.8",
+ version: "0.7.9",
_idx: 0,
guid: function(pre) {
var id = (new Date()).getTime() + '_' + (++YUITest._idx);
@@ -1992,7 +1992,7 @@ YUITest.Results = function(name){
* @property duration
*/
this.duration = 0;
-}
+};
/**
* Includes results from another results object into this one.
@@ -3448,12 +3448,19 @@ YUITest.CoverageFormat = {
* format is specified, a string representing the results in that format.
* @method getCoverage
*/
- getCoverage: function(format){
- if (!this._running && typeof _yuitest_coverage == "object"){
- if (typeof format == "function"){
- return format(_yuitest_coverage);
+ getCoverage: function(format) {
+ var covObject = null;
+ if (typeof _yuitest_coverage === "object") {
+ covObject = _yuitest_coverage;
+ }
+ if (typeof __coverage__ === "object") {
+ covObject = __coverage__;
+ }
+ if (!this._running && typeof covObject == "object"){
+ if (typeof format == "function") {
+ return format(covObject);
} else {
- return _yuitest_coverage;
+ return covObject;
}
} else {
return null;
@@ -10,7 +10,7 @@
*/
var YUITest = {
- version: "0.7.8",
+ version: "0.7.9",
_idx: 0,
guid: function(pre) {
var id = (new Date()).getTime() + '_' + (++YUITest._idx);
@@ -1992,7 +1992,7 @@ YUITest.Results = function(name){
* @property duration
*/
this.duration = 0;
-}
+};
/**
* Includes results from another results object into this one.
@@ -4604,12 +4604,19 @@ YUITest.PageManager = YUITest.Util.mix(new YUITest.EventTarget(), {
* format is specified, a string representing the results in that format.
* @method getCoverage
*/
- getCoverage: function(format){
- if (!this._running && typeof _yuitest_coverage == "object"){
- if (typeof format == "function"){
- return format(_yuitest_coverage);
+ getCoverage: function(format) {
+ var covObject = null;
+ if (typeof _yuitest_coverage === "object") {
+ covObject = _yuitest_coverage;
+ }
+ if (typeof __coverage__ === "object") {
+ covObject = __coverage__;
+ }
+ if (!this._running && typeof covObject == "object"){
+ if (typeof format == "function") {
+ return format(covObject);
} else {
- return _yuitest_coverage;
+ return covObject;
}
} else {
return null;
Oops, something went wrong.
@@ -42,16 +42,7 @@ YUITest.CLI = {
},
quit: function(code){
-
- //Workaround for https://github.com/joyent/node/issues/1669
- var flushed = process.stdout.flush && process.stdout.flush();
- if (!flushed && (parseFloat(process.versions.node) < 0.5)) {
- process.once("drain", function () {
- process.exit(code || 0);
- });
- } else {
- process.exit(code || 0);
- }
+ process.exit(code || 0);
},
isDirectory: function(name) {
@@ -512,6 +503,9 @@ YUITest.Util.mix(YUITest.CLI, {
this.processArguments();
this.processFiles();
+ YUITest.TestRunner.subscribe(YUITest.TestRunner.COMPLETE_EVENT, function(event) {
+ YUITest.CLI.quit(event.results.failed ? 1 : 0);
+ });
YUITest.TestRunner.run({
groups: this.options.groups ? this.options.groups.split(",") : null
Oops, something went wrong.

0 comments on commit ddd63e5

Please sign in to comment.