Created
March 4, 2012 01:11
-
-
Save marlun/1969745 to your computer and use it in GitHub Desktop.
Testing express apps
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.createServer() | |
| app.listen(8000) | |
| console.log("Started listening on port 8000") |
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 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