Skip to content

Commit

Permalink
npm changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Feb 14, 2011
1 parent c1ca760 commit 300519f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
10 changes: 6 additions & 4 deletions javascript/build/yuitest/npm/cli.js
Expand Up @@ -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){
Expand All @@ -81,7 +82,7 @@ files = files.map(function(filename){
});

//-----------------------------------------------------------------------------
// Setup TestRunner
// Determine output format
//-----------------------------------------------------------------------------

//TODO: Other types of output
Expand Down Expand Up @@ -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);
}

//-----------------------------------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions javascript/build/yuitest/npm/package.json
Expand Up @@ -17,9 +17,6 @@
"bin": {
"yuitest": "./cli.js"
},
/*"dependencies": {
"yui3-core": ">=3.3.0",
},*/
"licenses":[
{
"type" : "BSD",
Expand Down
3 changes: 0 additions & 3 deletions javascript/npm/package.json
Expand Up @@ -17,9 +17,6 @@
"bin": {
"yuitest": "./cli.js"
},
/*"dependencies": {
"yui3-core": ">=3.3.0",
},*/
"licenses":[
{
"type" : "BSD",
Expand Down
10 changes: 6 additions & 4 deletions javascript/src/nodejs/cli.js
Expand Up @@ -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){
Expand All @@ -81,7 +82,7 @@ files = files.map(function(filename){
});

//-----------------------------------------------------------------------------
// Setup TestRunner
// Determine output format
//-----------------------------------------------------------------------------

//TODO: Other types of output
Expand Down Expand Up @@ -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);
}

//-----------------------------------------------------------------------------
Expand Down

0 comments on commit 300519f

Please sign in to comment.