Last active
December 16, 2015 23:49
-
-
Save mid0111/5516003 to your computer and use it in GitHub Desktop.
integration tests for express with mocha.
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
var express = require('express'); | |
// ... | |
var app = module.exports = express(); | |
// ... |
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
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); | |
}); | |
}); | |
}); |
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
{ | |
: | |
"devDependencies": { | |
: | |
"mocha": "*", | |
"supertest": "0.6.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment