Created
November 9, 2010 21:11
-
-
Save tristanoneil/669819 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
require.paths.unshift(__dirname + '/modules', __dirname + '/lib/node', __dirname); | |
var express = require('express'); | |
var app = module.exports = new express.Server(); | |
app.configure(function() { | |
app.use(express.cookieDecoder()); | |
app.use(express.session()); | |
}); | |
app.get('/', function(req, res) { | |
res.send('Hello World'); | |
}); | |
/** | |
* TEST config: | |
*/ | |
app.configure('test', function() { | |
var MemoryStore = express.session.MemoryStore; | |
app.use(express.session({ store: new MemoryStore({ reapInterval: -1 }) })); | |
}); |
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
require.paths.unshift(__dirname + '/../modules', __dirname + '/../lib/node', __dirname, __dirname + '/../'); | |
var app = require('app'); | |
module.exports = { | |
'simple test': function(assert){ | |
// Simple equality check | |
assert.equal(6, 'foobar'.length); | |
// Check that node stack is setup properly | |
assert.response(app, { | |
url: '/', | |
timeout: 500 | |
}, { | |
body: /Hello/, | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment