Skip to content

Instantly share code, notes, and snippets.

@serby
Created February 18, 2013 14:51
Show Gist options
  • Select an option

  • Save serby/4977948 to your computer and use it in GitHub Desktop.

Select an option

Save serby/4977948 to your computer and use it in GitHub Desktop.
var request = require('supertest')
, express = require('express')
, app = express()
app.get('/', function (req, res) {
res.end()
})
var server = app.listen(function () {
request(app)
.get('/')
.expect(200)
.end(function () {
console.log('supertest request completed')
server.close()
})
})
process.on('exit', function () {
console.log('You will never see this.')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment