-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
34 lines (31 loc) · 1.09 KB
/
test.js
File metadata and controls
34 lines (31 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var should = require("should");
var request = require("request");
var port = 221;
describe('Protolus', function(){
describe('can', function(){
var Protolus = require('./protolus-combined');
var application;
var running = false;
before(function(done){
application = Protolus.PanelServer({port:port});
application.start(function(){
running = true;
done();
});
});
it('run', function(){
should.equal(running, true);
});
it('serve a response', function(done){
request('http://localhost:'+port+'/index', function (error, response, body) {
if (!error && response.statusCode == 200) {
body.should.not.equal('');
}
if(error) should.fail('Error fetching URL', error);
if(response.statusCode != 200) should.fail('Fetch not OK', 'Code:'+response.statusCode);
body.should.match(/Success/);
done();
});
});
});
});