1 | var assert = require ('assert');
|
2 | var atlasboard = require ('../lib/atlasboard');
|
3 |
|
4 | describe ('atlasboard', function(){
|
5 | describe ('start', function(){
|
6 |
|
7 | it('should start without errors', function(done){
|
8 | atlasboard({port: 4000}, function(err){
|
9 | assert.ifError(err);
|
10 | done();
|
11 | });
|
12 | });
|
13 |
|
14 | it('should throw error if port is not specified', function(done){
|
15 |
|
16 | var list = process.listeners ('uncaughtException');
|
17 | process.removeAllListeners('uncaughtException');
|
18 | process.on('uncaughtException', function (error) {
|
19 | process.removeAllListeners('uncaughtException');
|
20 | for (var i = list.length - 1; i >= 0; i--) {
|
21 | process.on('uncaughtException', list[i]);
|
22 | }
|
23 | });
|
24 | atlasboard(null, function(err){
|
25 | assert.ok(err);
|
26 | done();
|
27 | });
|
28 | });
|
29 |
|
30 | });
|
31 | });
|