Skip to content
Myr

node.js

This file

Path

spec/node.js

65 lines · 1.2 KiB · JavaScript

Last changed by

Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoptione125ae2

History of this file

Take it

Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption6f7141a

lines 1–19why, one step back
1
2require.paths.unshift('spec', 'lib', 'spec/lib', 'spec/support/libxmljs')3require("jspec")4require("express")5require("express/spec")67quit = process.exit8print = puts910readFile = function(path) {11 var result12 require('posix')13 .cat(path, "utf8")14 .addCallback(function(contents){ result = contents })15 .addErrback(function(){ throw new Error("failed to read file `" + path + "'") })16 .wait()17 return result18}19

Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoptione125ae2

lines 20–65why, one step back
20function run(specs) {
21 specs.forEach(function(spec){22 JSpec.exec('spec/spec.' + spec + '.js')23 })24}2526specs = {27 independant: [28 'core',29 'routing',30 'helpers',31 'request',32 'mime',33 'static',34 'collection',35 'plugins',36 'plugins.view',37 'plugins.common-logger',38 'plugins.content-length',39 'plugins.method-override',40 'plugins.body-decoder',41 'plugins.redirect',42 'plugins.hooks',43 'plugins.cookie',44 ],45 dependant: [46 'element-collection'47 ]48}4950switch (process.ARGV[2]) {51 case 'independant':52 run(specs.independant)53 break54 case 'dependant':55 run(specs.dependant)56 break57 case 'all':58 run(specs.independant)59 run(specs.dependant)60 break61 default: 62 run([process.ARGV[2]])63}6465JSpec.run({ reporter: JSpec.reporters.Terminal, failuresOnly: true }).report()