Refactoring tests hooks

This commit is contained in:
Daniel García Aubert 2017-07-31 18:52:09 +02:00
parent 49d2f513c6
commit bb59902535

View File

@ -58,21 +58,19 @@ const createMapConfig = ({
describe('user database timeout limit', function () {
describe('dataview', function () {
beforeEach(function (done) {
const mapconfig = createMapConfig();
this.testClient = new TestClient(mapconfig, 1234);
TestClient.setUserDatabaseTimeoutLimit('localhost', 200, done);
});
afterEach(function (done) {
TestClient.setUserDatabaseTimeoutLimit('localhost', 0, done);
});
beforeEach(function () {
const mapconfig = createMapConfig();
this.testClient = new TestClient(mapconfig, 1234);
});
afterEach(function (done) {
TestClient.setUserDatabaseTimeoutLimit('localhost', 0, (err) => {
if (err) {
return done(err);
}
this.testClient.drain(done);
});
});
it('layergroup creation works but dataview request fails due to statement timeout', function (done) {
const params = {