-
-
Save fiznool/0c9d32b1657228ef2cbd to your computer and use it in GitHub Desktop.
This file contains 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'), | |
app = express(); | |
app.configure(function() { | |
app.use(express.bodyParser()); | |
app.use(app.router); | |
}); | |
app.get('/', function(req, res) { | |
res.send(500); | |
}); | |
module.exports = app; |
This file contains 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
{ | |
"name": "supertest-issue", | |
"version": "0.0.1", | |
"private": true, | |
"dependencies": { | |
"express": "3.x", | |
"expect": "^0.1.1", | |
"expect.js": "^0.3.1" | |
}, | |
"devDependencies": { | |
"mocha": "*", | |
"supertest": "*" | |
}, | |
"scripts": { | |
"test": "node_modules/mocha/bin/mocha ./test.js" | |
} | |
} |
This file contains 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'), | |
expect = require('expect.js'), | |
app = require('./app'); | |
describe('check status 500', function() { | |
it('is correct', function(done) { | |
request(app) | |
.get('/') | |
.expect(500, done); | |
}); | |
it('is not correct', function(done) { | |
request(app) | |
.get('/') | |
.expect(404) | |
.end(function(err) { | |
expect(err).not.to.be(undefined); | |
done(err); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment