Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

npm changes

  • Loading branch information...
commit 300519f8717fc78232846d51f9569c144dfb0e76 1 parent c1ca760
nzakas authored
View
10 javascript/build/yuitest/npm/cli.js
@@ -56,9 +56,10 @@ function getFiles(dir){
// Process command line
//-----------------------------------------------------------------------------
+
var args = process.argv.slice(2),
arg = args.shift(),
- files = [];
+ files = [];
while(arg){
if (arg.indexOf("--") == 0){
@@ -81,7 +82,7 @@ files = files.map(function(filename){
});
//-----------------------------------------------------------------------------
-// Setup TestRunner
+// Determine output format
//-----------------------------------------------------------------------------
//TODO: Other types of output
@@ -109,14 +110,15 @@ if (files.length){
for (i=0, len=files.length; i < len; i++){
if (options.verbose){
- stderr.write("Loading " + files[i] + "\n");
+ stderr.write("[INFO] Loading " + files[i] + "\n");
}
var output = fs.readFileSync(files[i]);
vm.runInThisContext("(function(YUITest){\n" + output + "\n})", files[i])(YUITest);
}
} else {
- process.stdout.write("No tests to run.\n");
+ stderr.write("[ERROR] No tests to run, exiting.\n");
+ process.exit(1);
}
//-----------------------------------------------------------------------------
View
3  javascript/build/yuitest/npm/package.json
@@ -17,9 +17,6 @@
"bin": {
"yuitest": "./cli.js"
},
- /*"dependencies": {
- "yui3-core": ">=3.3.0",
- },*/
"licenses":[
{
"type" : "BSD",
View
3  javascript/npm/package.json
@@ -17,9 +17,6 @@
"bin": {
"yuitest": "./cli.js"
},
- /*"dependencies": {
- "yui3-core": ">=3.3.0",
- },*/
"licenses":[
{
"type" : "BSD",
View
10 javascript/src/nodejs/cli.js
@@ -56,9 +56,10 @@ function getFiles(dir){
// Process command line
//-----------------------------------------------------------------------------
+
var args = process.argv.slice(2),
arg = args.shift(),
- files = [];
+ files = [];
while(arg){
if (arg.indexOf("--") == 0){
@@ -81,7 +82,7 @@ files = files.map(function(filename){
});
//-----------------------------------------------------------------------------
-// Setup TestRunner
+// Determine output format
//-----------------------------------------------------------------------------
//TODO: Other types of output
@@ -109,14 +110,15 @@ if (files.length){
for (i=0, len=files.length; i < len; i++){
if (options.verbose){
- stderr.write("Loading " + files[i] + "\n");
+ stderr.write("[INFO] Loading " + files[i] + "\n");
}
var output = fs.readFileSync(files[i]);
vm.runInThisContext("(function(YUITest){\n" + output + "\n})", files[i])(YUITest);
}
} else {
- process.stdout.write("No tests to run.\n");
+ stderr.write("[ERROR] No tests to run, exiting.\n");
+ process.exit(1);
}
//-----------------------------------------------------------------------------
Please sign in to comment.
Something went wrong with that request. Please try again.