Permalink
Browse files

Fix the unit tests

  • Loading branch information...
1 parent 720ba1c commit 62dafb99633d30154efa357db80eefadedd17239 @creationix committed Jan 28, 2011
Showing with 21 additions and 3 deletions.
  1. +3 −1 lib/step.js
  2. +4 −2 test/errorTest.js
  3. +14 −0 test/groupTest.js
View
@@ -1,5 +1,7 @@
/*
-Copyright (c) 2010 Tim Caswell <tim@creationix.com>
+Copyright (c) 2011 Tim Caswell <tim@creationix.com>
+
+MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -3,15 +3,17 @@ require('./helper');
var exception = new Error('Catch me!');
expect('one');
+expect('timeout');
expect('two');
expect('three');
Step(
function () {
fulfill('one');
var callback = this;
setTimeout(function () {
+ fulfill('timeout');
callback(exception);
- });
+ }, 0);
},
function (err) {
fulfill('two');
@@ -22,4 +24,4 @@ Step(
fulfill('three');
assert.equal(exception, err, "error should be caught");
}
-);
+);
View
@@ -31,3 +31,17 @@ Step(
assert.deepEqual(dirResults, files);
}
);
+
+expect('four');
+expect('five');
+// When the group is empty, it should fire with an empty array
+Step(
+ function start() {
+ var group = this.group();
+ fulfill('four');
+ },
+ function readFiles(err, results) {
+ fulfill('five');
+ assert.deepEqual(results, []);
+ }
+);

0 comments on commit 62dafb9

Please sign in to comment.