Skip to content

Commit

Permalink
Added a test case
Browse files Browse the repository at this point in the history
  • Loading branch information
johvik committed Feb 8, 2014
1 parent 698d2af commit 1630a79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports.run = function(options, callback) {
// err = error code when exit
switch (err) {
case 1:
err = 'Child did not get a correct message';
err = 'Child did not get a script';
break;
case 2:
err = 'Child threw an exception';
Expand Down
7 changes: 7 additions & 0 deletions test/sandbox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ describe('sandbox', function() {
});
});

it('should return error', function(done) {
sandbox.run({}, function(err) {
err.should.equal('Child did not get a script');
done();
});
});

it('should throw', function(done) {
sandbox.run({
script: 'throw 1;'
Expand Down

0 comments on commit 1630a79

Please sign in to comment.