2013-08-12 3 views
0

유성 0.6.4.1, 라이카 0.2.24 및 node.js 0.10.12를 사용하고 있습니다. tdd를 사용한 테스트는 정상적으로 작동했지만 bdd를 laika와 함께 사용하려고 시도했지만 실패했습니다. 이 데모 프로젝트 https://github.com/zvictor/laika-extended-example을 다운로드했지만 실패했습니다. 나는 모카와 간단한 테스트를했고 (유성이 아닌 node.js 만) 잘 작동했다. 이것은 내가 데모 프로젝트에있어 오류입니다 : 내가 skishore의 의견을 바탕으로 sudo npm install -g should라이카가 bdd로 작동하도록 할 수 없습니다

편집 2

으로 should을 설치

module.js:340 
    throw err; 
     ^
Error: Cannot find module 'should' 
    at Function.Module._resolveFilename (module.js:338:15) 
    at Function.Module._load (module.js:280:25) 
    at Module.require (module.js:364:17) 
    at require (module.js:380:17) 
    at Object.<anonymous> (/Users/camilo/Documents/Pruebas/Meteor/laika-extended-example/tests/$setup.js:1:72) 
    at Module._compile (module.js:456:26) 
    at Object.Module._extensions..js (module.js:474:10) 
    at Module.load (module.js:356:32) 
    at Function.Module._load (module.js:312:12) 
    at Module.require (module.js:364:17) 

편집, 나는 npm link should 사용 이제 문제가 바뀌 었습니다. 첫째, 나는 그것을 가지고 :

injecting laika... 
loading phantomjs... 
loading initial app pool... 

그리고 아무것도 더 그래서 로그를 볼 수 laika -D와 시도 일 다음 Github에서의 추가 정보에서

[laika log] accepting the following extensions: (js) 

    injecting laika... 
    loading phantomjs... 
[app touch log] [[[[[ ~/Documents/Pruebas/Meteor/laika-extended-example ]]]]] 

[app touch log] => Meteor server running on: http://localhost:20472/ 
    loading initial app pool... 
[laika log] using nodejs bin(from meteor): /Users/camilo/.meteor/tools/11f45b3996/bin/node 
[server log] 
[server log] /Users/camilo/Documents/Pruebas/Meteor/laika-extended-example/.meteor/local/build/server/server.js:325 
    }).run(); 
    ^
[server log] ReferenceError: module is not defined 
    at app/node_modules/should/lib/eql.js:5:1 
    at /Users/camilo/Documents/Pruebas/Meteor/laika-extended-example/.meteor/local/build/server/server.js:286:12 
    at Array.forEach (native) 
    at Function._.each._.forEach (/Users/camilo/.meteor/tools/11f45b3996/lib/node_modules/underscore/underscore.js:79:11) 
    at run (/Users/camilo/Documents/Pruebas/Meteor/laika-extended-example/.meteor/local/build/server/server.js:227:7) 

답변

0

: 당신이해야 설치해야합니다. npm을 사용하십시오 :

sudo npm install -g should 
+0

이미 그것을했습니다 – Camilo

+0

당신은 그것을 가지고 있는지 정말 간단한 테스트를 해보시겠습니까? 어쩌면 한 줄의 파일'node'만이'should = require ('should');'일 것이다. – disatisfieddinosaur

+0

당신은 전역 적으로 설치 했으므로 require 문을 작동 시키려면'npm link'를 사용해야합니다. https://npmjs.org/doc/folders.html – disatisfieddinosaur

관련 문제