Skip to content

Instantly share code, notes, and snippets.

@Rafase282
Created August 24, 2016 00:49
Show Gist options
  • Save Rafase282/ae6fe8f0ff391b150fd0dab4942b0ee7 to your computer and use it in GitHub Desktop.
Save Rafase282/ae6fe8f0ff391b150fd0dab4942b0ee7 to your computer and use it in GitHub Desktop.
MangaDB: Testing the server
/*eslint no-unused-vars: ["error", { "varsIgnorePattern": "expect" }]*/
/*global describe it */
var request = require('supertest');
var expect = require('chai').expect;
var server = require('../server.js');
server = request.agent('http://localhost:' + process.env.PORT);
describe('SAMPLE unit test', function() {
it('GET /: Respond with html site', function(done) {
server
.get('/')
.expect('Content-Type', 'application/json; charset=utf-8')
.expect(200, done);
}); // END JSON MSG
it('GET /api: Respond with Json msg', function(done) {
server
.get('/api')
.expect('Content-Type', /json/)
.expect(200, done);
}); // END JSON MSG
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment