Skip to content

Instantly share code, notes, and snippets.

@mid0111
Last active December 16, 2015 23:49
Show Gist options
  • Save mid0111/5516003 to your computer and use it in GitHub Desktop.
Save mid0111/5516003 to your computer and use it in GitHub Desktop.
integration tests for express with mocha.
var express = require('express');
// ...
var app = module.exports = express();
// ...
var request = require('supertest'),
app = require('../app');
describe('/', function() {
var requestPath = '/';
describe('GET', function() {
it('GETで200が返却されること', function(done) {
request(app)
.get(requestPath)
.expect(200, done);
});
});
});
{
:
"devDependencies": {
:
"mocha": "*",
"supertest": "0.6.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment