Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

npm changes

  • Loading branch information...
commit 300519f8717fc78232846d51f9569c144dfb0e76 1 parent c1ca760
Nicholas C. Zakas nzakas authored
10 javascript/build/yuitest/npm/cli.js
@@ -56,9 +56,10 @@ function getFiles(dir){
56 56 // Process command line
57 57 //-----------------------------------------------------------------------------
58 58
  59 +
59 60 var args = process.argv.slice(2),
60 61 arg = args.shift(),
61   - files = [];
  62 + files = [];
62 63
63 64 while(arg){
64 65 if (arg.indexOf("--") == 0){
@@ -81,7 +82,7 @@ files = files.map(function(filename){
81 82 });
82 83
83 84 //-----------------------------------------------------------------------------
84   -// Setup TestRunner
  85 +// Determine output format
85 86 //-----------------------------------------------------------------------------
86 87
87 88 //TODO: Other types of output
@@ -109,14 +110,15 @@ if (files.length){
109 110 for (i=0, len=files.length; i < len; i++){
110 111
111 112 if (options.verbose){
112   - stderr.write("Loading " + files[i] + "\n");
  113 + stderr.write("[INFO] Loading " + files[i] + "\n");
113 114 }
114 115
115 116 var output = fs.readFileSync(files[i]);
116 117 vm.runInThisContext("(function(YUITest){\n" + output + "\n})", files[i])(YUITest);
117 118 }
118 119 } else {
119   - process.stdout.write("No tests to run.\n");
  120 + stderr.write("[ERROR] No tests to run, exiting.\n");
  121 + process.exit(1);
120 122 }
121 123
122 124 //-----------------------------------------------------------------------------
3  javascript/build/yuitest/npm/package.json
@@ -17,9 +17,6 @@
17 17 "bin": {
18 18 "yuitest": "./cli.js"
19 19 },
20   - /*"dependencies": {
21   - "yui3-core": ">=3.3.0",
22   - },*/
23 20 "licenses":[
24 21 {
25 22 "type" : "BSD",
3  javascript/npm/package.json
@@ -17,9 +17,6 @@
17 17 "bin": {
18 18 "yuitest": "./cli.js"
19 19 },
20   - /*"dependencies": {
21   - "yui3-core": ">=3.3.0",
22   - },*/
23 20 "licenses":[
24 21 {
25 22 "type" : "BSD",
10 javascript/src/nodejs/cli.js
@@ -56,9 +56,10 @@ function getFiles(dir){
56 56 // Process command line
57 57 //-----------------------------------------------------------------------------
58 58
  59 +
59 60 var args = process.argv.slice(2),
60 61 arg = args.shift(),
61   - files = [];
  62 + files = [];
62 63
63 64 while(arg){
64 65 if (arg.indexOf("--") == 0){
@@ -81,7 +82,7 @@ files = files.map(function(filename){
81 82 });
82 83
83 84 //-----------------------------------------------------------------------------
84   -// Setup TestRunner
  85 +// Determine output format
85 86 //-----------------------------------------------------------------------------
86 87
87 88 //TODO: Other types of output
@@ -109,14 +110,15 @@ if (files.length){
109 110 for (i=0, len=files.length; i < len; i++){
110 111
111 112 if (options.verbose){
112   - stderr.write("Loading " + files[i] + "\n");
  113 + stderr.write("[INFO] Loading " + files[i] + "\n");
113 114 }
114 115
115 116 var output = fs.readFileSync(files[i]);
116 117 vm.runInThisContext("(function(YUITest){\n" + output + "\n})", files[i])(YUITest);
117 118 }
118 119 } else {
119   - process.stdout.write("No tests to run.\n");
  120 + stderr.write("[ERROR] No tests to run, exiting.\n");
  121 + process.exit(1);
120 122 }
121 123
122 124 //-----------------------------------------------------------------------------

0 comments on commit 300519f

Please sign in to comment.
Something went wrong with that request. Please try again.