Skip to content

Instantly share code, notes, and snippets.

@marlun
Created March 4, 2012 01:11
Show Gist options
  • Select an option

  • Save marlun/1969745 to your computer and use it in GitHub Desktop.

Select an option

Save marlun/1969745 to your computer and use it in GitHub Desktop.
Testing express apps
var express = require('express')
var app = module.exports = express.createServer()
app.listen(8000)
console.log("Started listening on port 8000")
var http = require('http')
var assert = require('assert')
var server = require('./index')
describe('Server', function() {
it('should allow accessing /', function() {
http.get({ path: '/', port: 8000 }, function(res) {
assert.ok(res.statusCode === 200)
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment