Skip to content
Myr

Added node.js JSpec testing support

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 50b3c2c · Browse files · 6 files+44 added−101 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+44 added−101 removed

  • tests:+43 added−100 removed
  • other:+1 added−1 removed

6 files+44 added−101 removed

modified:lib/express.core.js+1 added-1 removed
592 unmodified lines
593get('/user/:name', function(){594 'User ' + param('name')595})596597Express.start()597// Express.start()
modified:spec/spec.core.js-41 removed
deleted:spec/spec.dom.html-25 removed
added:spec/spec.node.js+43 added
12__loading__ = []3__loadDelay__ = 50045readFile = function(path, callback) {6 __loading__.push(path)7 var promise = node.fs.cat(path, "utf8")8 promise.addErrback(function(){ throw "failed to read file `" + path + "'" })9 promise.addCallback(function(contents){10 setTimeout(function(){11 if (__loading__[0] == path)12 __loading__.shift(), callback(contents)13 else14 setTimeout(arguments.callee, 50)15 }, 50)16 }) 17}1819load = function(path) {20 readFile(path, function(contents){21 eval(contents)22 })23}2425load('/Users/tjholowaychuk/scripts/gems/JSpec/lib/jspec.js')26load('lib/express.core.js')27load('lib/express.mime.js')28load('lib/express.view.js')2930setTimeout(function(){31 JSpec32 .exec('spec/spec.core.js')33 .exec('spec/spec.routing.js')34 .exec('spec/spec.mime.js')35 .exec('spec/spec.view.js')36 setTimeout(function(){ 37 JSpec.run({ formatter : JSpec.formatters.Terminal, failuresOnly : true })38 setTimeout(function() {39 JSpec.report()40 }, __loadDelay__ / 3)41 }, __loadDelay__ / 3)42}, __loadDelay__ / 3)43
deleted:spec/spec.rhino.js-13 removed
deleted:spec/spec.server.html-21 removed
1<html>2 <head>3 <script src="jspec.js"></script>4 <script src="../lib/express.core.js"></script>5 <script src="../lib/express.mime.js"></script>6 <script src="../lib/express.view.js"></script>7 <script>8 function runSuites() {9 JSpec10 .exec('spec.core.js')11 .exec('spec.routing.js')12 .exec('spec.mime.js')13 .exec('spec.view.js')14 .run()15 .reportToServer()16 }17 </script>18 </head>19 <body class="jspec" onLoad="runSuites();">20 </body>21</html>