Skip to content

Instantly share code, notes, and snippets.

@tristanoneil
Created November 9, 2010 21:11
Show Gist options
  • Save tristanoneil/669819 to your computer and use it in GitHub Desktop.
Save tristanoneil/669819 to your computer and use it in GitHub Desktop.
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 }) }));
});
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