Skip to content

Instantly share code, notes, and snippets.

@austinbv
Created July 23, 2012 02:58
Show Gist options
  • Save austinbv/3161802 to your computer and use it in GitHub Desktop.
Save austinbv/3161802 to your computer and use it in GitHub Desktop.
fs = require('fs');
require('coffee-script');
process.env.NODE_ENV = 'test';
/**
* Module dependencies.
*/
var express = require('express'),
stylus = require('stylus'),
nib = require('nib'),
http = require('http');
var app = express();
app.configure(function(){
app.set('port', process.env.PORT || 8888);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(require('connect-assets')({
src: '../../assets'
}));
app.use(express['static'](__dirname + '/tests'));
});
css.root = 'stylesheets';
js.root = 'javascripts';
app.get('/', function(req, res) {
res.render(__dirname + '/runner', {
mocha_js: fs.readFileSync('../node_modules/mocha/mocha.js'),
mocha_css: fs.readFileSync('../node_modules/mocha/mocha.css')
});
});
http.createServer(app).listen(app.get('port'), function(){
console.log("Express server listening on port " + app.get('port'));
});
html
head
meta(charset="utf-8")
title | Mocha Tests
!= js('vendor')
style!= mocha_css
script!= mocha_js
script mocha.setup('bdd');
script
$(function() {
mocha.run();
});
body
#mocha
#mocha-content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment