Created
August 24, 2016 00:49
-
-
Save Rafase282/ae6fe8f0ff391b150fd0dab4942b0ee7 to your computer and use it in GitHub Desktop.
MangaDB: Testing the server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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