e-ucm/rage-analytics-backend

View on GitHub
test/tests/health.js

Summary

Maintainability
A
50 mins
Test Coverage
/*
 * Copyright 2016 e-UCM (http://www.e-ucm.es/)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * This project has received funding from the European Union’s Horizon
 * 2020 research and innovation programme under grant agreement No 644187.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0 (link is external)
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

'use strict';

var should = require('should');

module.exports = function(request) {
    /**-------------------------------------------------------------**/
    /**-------------------------------------------------------------**/
    /**                      Test Health                            **/
    /**-------------------------------------------------------------**/
    /**-------------------------------------------------------------**/
    describe('Health test', function () {
        it('should return status 200', function (done) {
            request.get('/api/health')
                .expect(200)
                .set('Accept', 'application/json')
                .expect('Content-Type', /json/)
                .end(function (err, res) {
                    should.not.exist(err);
                    should(res.body).be.Object();
                    done();
                });
        });
    });
};