Permalink
Browse files

test runner fixes for new npm

  • Loading branch information...
1 parent 469ea1c commit 74c1eff1c72768c45bdbe6fe9e010b4ebfaafac5 @cadorn cadorn committed Nov 6, 2012
Showing with 25 additions and 24 deletions.
  1. +10 −10 examples/04-PlatformFeatures/main.js
  2. +10 −10 examples/06-Demos/main.js
  3. +5 −4 tests/examples.js
@@ -36,24 +36,24 @@ function runExample(path)
EXEC("npm install", {
cwd: path
- }, function(err, stdout, stderr)
+ }, function(error, stdout, stderr)
{
- if (err) deferred.reject(err);
- else if (stderr) deferred.reject(stderr)
- else {
+ if (error) {
+ console.error(stderr);
+ deferred.reject(new Error("Error running: npm install (cwd: " + path + ")"));
+ } else {
process.stdout.write(stdout);
EXEC("npm test", {
cwd: path
- }, function(err, stdout, stderr)
+ }, function(error, stdout, stderr)
{
- if (err) deferred.reject(err);
- else if (stderr) deferred.reject(stderr)
- else {
-
+ if (error) {
+ console.error(stderr);
+ deferred.reject(new Error("Error running: npm test (cwd: " + path + ")"));
+ } else {
process.stdout.write(stdout);
-
deferred.resolve();
}
});
@@ -36,24 +36,24 @@ function runExample(path)
EXEC("npm install", {
cwd: path
- }, function(err, stdout, stderr)
+ }, function(error, stdout, stderr)
{
- if (err) deferred.reject(err);
- else if (stderr) deferred.reject(stderr)
- else {
+ if (error) {
+ console.error(stderr);
+ deferred.reject(new Error("Error running: npm install (cwd: " + path + ")"));
+ } else {
process.stdout.write(stdout);
EXEC("npm test", {
cwd: path
- }, function(err, stdout, stderr)
+ }, function(error, stdout, stderr)
{
- if (err) deferred.reject(err);
- else if (stderr) deferred.reject(stderr)
- else {
-
+ if (error) {
+ console.error(stderr);
+ deferred.reject(new Error("Error running: npm test (cwd: " + path + ")"));
+ } else {
process.stdout.write(stdout);
-
deferred.resolve();
}
});
View
@@ -51,11 +51,12 @@ exports.main = function(options)
EXEC("npm install", {
cwd: packageRootPath
- }, function(err, stdout, stderr)
+ }, function(error, stdout, stderr)
{
- if (err) deferred.reject(err);
- else if (stderr) deferred.reject(stderr)
- else {
+ if (error) {
+ console.error(stderr);
+ deferred.reject(new Error("Error running: npm install (cwd: " + packageRootPath + ")"));
+ } else {
process.stdout.write(stdout);
deferred.resolve();
}

0 comments on commit 74c1eff

Please sign in to comment.