Add first batch of tests

This commit is contained in:
Petr Sloup
2016-03-09 11:26:02 +01:00
parent 7ca7fc721f
commit 77755b548b
5 changed files with 79 additions and 0 deletions

20
test/setup.js Normal file
View File

@@ -0,0 +1,20 @@
process.env.NODE_ENV = 'test';
global.should = require('should');
global.supertest = require('supertest');
before(function(done) {
console.log('global setup');
process.chdir('test_data');
var running = require('../src/server')({
config: 'config.json',
port: 8888
}, done);
global.app = running.app;
global.server = running.server;
});
after(function() {
console.log('global teardown');
global.server.close(function() { console.log('Done'); });
});