Skip to content

Commit

Permalink
Added tests for !exit
Browse files Browse the repository at this point in the history
  • Loading branch information
EnKrypt committed Sep 16, 2016
1 parent c0f24cb commit 812c742
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion jasmine/spec/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,19 @@ describe('Botato', function() {
setTimeout(function() {
expect(output.includes(bot.version)).toBe(true);
done();
}, 3000)
}, 3000);
});
});
describe('!exit', function() {
it('should use process.exit to quit the bot', function(done) {
var bot = require('../../config');
var restore = process.exit;
process.exit = function(code) {
expect(code).toBe(0);
process.exit = restore;
done();
};
require('../../commands/exit')(bot, '', [], function() {});
});
});
});
Expand Down

0 comments on commit 812c742

Please sign in to comment.