2017-03-10 04:32:39 -06:00
|
|
|
/* eslint-disable no-unused-expressions */
|
|
|
|
|
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const chai = require('chai')
|
|
|
|
const expect = chai.expect
|
|
|
|
const series = require('async/series')
|
|
|
|
|
|
|
|
const serversUtils = require('../utils/servers')
|
|
|
|
const configUtils = require('../utils/config')
|
|
|
|
|
|
|
|
describe('Test config', function () {
|
|
|
|
let server = null
|
|
|
|
|
|
|
|
before(function (done) {
|
2017-07-02 13:48:31 -05:00
|
|
|
this.timeout(120000)
|
2017-03-10 04:32:39 -06:00
|
|
|
|
|
|
|
series([
|
|
|
|
function (next) {
|
|
|
|
serversUtils.flushTests(next)
|
|
|
|
},
|
|
|
|
function (next) {
|
|
|
|
serversUtils.runServer(1, function (server1) {
|
|
|
|
server = server1
|
|
|
|
next()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
], done)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Should have a correct config', function (done) {
|
|
|
|
configUtils.getConfig(server.url, function (err, res) {
|
|
|
|
if (err) throw err
|
|
|
|
|
|
|
|
const data = res.body
|
|
|
|
|
|
|
|
expect(data.signup.enabled).to.be.truthy
|
|
|
|
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
after(function (done) {
|
|
|
|
process.kill(-server.app.pid)
|
|
|
|
|
|
|
|
// Keep the logs if the test failed
|
|
|
|
if (this.ok) {
|
|
|
|
serversUtils.flushTests(done)
|
|
|
|
} else {
|
|
|
|
done()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|