mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
38 lines
833 B
JavaScript
38 lines
833 B
JavaScript
|
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)
|
||
|
})
|
||
|
})
|