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()
    &#10003; should add a router per method (18ms)
    &#10003; should  


  &#10004; 2 tests complete (29ms)

$

あるいは以下。

$ mocha --reporter spec test/acceptance/auth.js 


  auth
    GET /
      &#10003; should redirect to /login 
    GET /restricted (w/o cookie)
      &#10003; should redirect to /login 
    POST /login
      &#10003; should fail without proper credentials 
      &#10003; should authenticate (13ms)
    GET /restricted (w. cookie)
      &#10003; should respond with 200 
    GET /logout
      &#10003; should respond with 302 and clear cookie 
    GET /restricted (w. expired cookie)
      &#10003; should respond with 302 


  &#10004; 7 tests complete (48ms)

$

Node 塾の Ust 見たほうが良いかな。そして明日は自宅ぼっちそん。