express
手元に clone したナニがあったので git pull して npm install ですか。って 0.4.10 な node だと微妙らしい。
"engines": { "node":">= 0.5.0 < 0.7.0" } }
http://nodejs.org/dist/ によると現時点での最新は 0.6.13 らしい。
$ nvm install v0.6.13
で、再度 npm install して make test とのこと。
$ make test /bin/sh: ./node_modules/.bin/mocha: not found make: *** [test] Error 127 $
Makefile てきには
test: @NODE_ENV=test ./node_modules/.bin/mocha \ --reporter $(REPORTER)
なのだけど無いな。clone してイチからリトライしてみるか。
リトライ
npm install な出力が以下。
debug@0.6.0 ./node_modules/debug commander@0.5.2 ./node_modules/commander mime@1.2.5 ./node_modules/mime mkdirp@0.3.0 ./node_modules/mkdirp should@0.6.0 ./node_modules/should github-flavored-markdown@1.0.1 ./node_modules/github-flavored-markdown ejs@0.6.1 ./node_modules/ejs jade@0.21.0 ./node_modules/jade connect@2.0.0 ./node_modules/connect ├── qs@0.4.2 ├── mime@1.2.4 └── formidable@1.0.9 mocha@0.14.1 ./node_modules/mocha ├── growl@1.5.0 ├── diff@1.0.2 └── jade@0.20.3 stylus@0.24.0 ./node_modules/stylus ├── growl@1.4.1 └── cssom@0.2.2 connect-redis@1.2.0 ./node_modules/connect-redis └── redis@0.7.1
こんどは node_modules/.bin に mocha がある模様。make test は 288 test complete とのことでした。あとは順に test/ 配下を一つづつ試験を見ていけば良いのかな。
$ mocha --reporter spec test/app.all.js app.all() ✓ should add a router per method (18ms) ✓ should ✔ 2 tests complete (29ms) $
あるいは以下。
$ mocha --reporter spec test/acceptance/auth.js auth GET / ✓ should redirect to /login GET /restricted (w/o cookie) ✓ should redirect to /login POST /login ✓ should fail without proper credentials ✓ should authenticate (13ms) GET /restricted (w. cookie) ✓ should respond with 200 GET /logout ✓ should respond with 302 and clear cookie GET /restricted (w. expired cookie) ✓ should respond with 302 ✔ 7 tests complete (48ms) $
Node 塾の Ust 見たほうが良いかな。そして明日は自宅ぼっちそん。