Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ test.cb('should return a server when run and no port passed in', (t) => {
}
});

test.cb('should return a server when run with wrong port passed in', (t) => {
const noPortApp = require('./index');

t.not(noPortApp.server({
routeJSONPath: './test_stubs/routes_stub.json'
, routePath: './test_stubs'
, port: 'qwerty'
, log: {
log: () => {}
}
}));

noPortApp.events.once('server:started', (settings) => {
servers.push(settings.server);
t.true(settings.server instanceof http.Server);
Expand All @@ -86,6 +98,19 @@ test.cb('should return a server when run and compress passed in', (t) => {
}
});

test.cb('should return a server when run and compress passed in', (t) => {
const compressApp = require('./index');

compressApp.server({
routeJSONPath: './test_stubs/routes_stub.json'
, compress: true
, routePath: './test_stubs'
, port: 9997
, log: {
log: () => {}
}
});

compressApp.events.once('server:started', (settings) => {
servers.push(settings.server);
t.true(settings.server instanceof http.Server);
Expand Down
Loading