Camilo
Camilo

Reputation: 2853

I can't get laika to work with bdd

I'm using meteor 0.6.4.1, laika 0.2.24 and node.js 0.10.12. Tests with tdd worked fine, but I tried to use bdd with laika and it failed. I downloaded this demo project https://github.com/zvictor/laika-extended-example but also failed. I made a simple test with mocha and should (only node.js, not meteor) and worked fine. This is the error I got with the demo project:

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)

Edit

I installed should with sudo npm install -g should

Edit 2

Based on skishore comment, I used npm link should and now the problem changed. First, I got it:

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

And nothing more happen so I tried with laika -D to see the logs:

[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)

Upvotes: 0

Views: 385

Answers (1)

disatisfieddinosaur
disatisfieddinosaur

Reputation: 1550

From the readme in the Github: you need to install should. Use npm:

 sudo npm install -g should

Upvotes: 0

Related Questions