arma-server-web-admin/test/app.js

38 lines
833 B
JavaScript
Raw Normal View History

2018-12-02 22:06:48 +00:00
const request = require('supertest')
const app = require('../app')
function requestPath (path, contentType, done) {
request(app)
.get(path)
.expect('Content-Type', contentType)
.expect(200)
.end(done)
}
describe('App', function () {
it('should serve main page', function (done) {
requestPath('/', /html/, done)
})
it('should serve logs', function (done) {
requestPath('/api/logs', /json/, done)
})
it('should serve missions', function (done) {
requestPath('/api/missions', /json/, done)
})
it('should serve mods', function (done) {
requestPath('/api/mods', /json/, done)
})
it('should serve servers', function (done) {
requestPath('/api/servers', /json/, done)
})
it('should serve settings', function (done) {
requestPath('/api/settings', /json/, done)
})
})