Skip to content
Myr

node.js

This file

Path

spec/node.js

66 lines · 1.3 KiB · JavaScript

Last changed by

Started caching apivisionmediabefore adoptionc161750

History of this file

Take it

Updated to JSpec 3.0.0visionmediabefore adoption694572b

lines 1–10why, 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) {

Refactored node spec runnervisionmediabefore adoption6f995d0

lines 11–16why, one step back
11 var result
12 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()

Updated to JSpec 3.0.0visionmediabefore adoption694572b

lines 17–19why, one step back
17 return result
18}19

Specs can now run independant specs for those who cant build deps. Closes #127visionmediabefore adoptiona09c773

lines 20–35why, 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',

Started caching apivisionmediabefore adoptionc161750

line 36why, one step back
36 'plugins.cache',

Specs can now run independant specs for those who cant build deps. Closes #127visionmediabefore adoptiona09c773

lines 37–66why, one step back
37 'plugins.view',
38 'plugins.common-logger',39 'plugins.content-length',40 'plugins.method-override',41 'plugins.body-decoder',42 'plugins.redirect',43 'plugins.hooks',44 'plugins.cookie',45 ],46 dependant: [47 'element-collection'48 ]49}5051switch (process.ARGV[2]) {52 case 'independant':53 run(specs.independant)54 break55 case 'dependant':56 run(specs.dependant)57 break58 case 'all':59 run(specs.independant)60 run(specs.dependant)61 break62 default: 63 run([process.ARGV[2]])64}6566JSpec.run({ reporter: JSpec.reporters.Terminal, failuresOnly: true }).report()