Trying to ru tests of derbyjs

104 views
Skip to first unread message

Juzer Ali

unread,
Nov 8, 2012, 2:38:55 AM11/8/12
to der...@googlegroups.com
I tried to run tests for Derbyjs on my Ubuntu 12.10. First I got error that mocha doesn't exists inside ./node_modules/racer/node_modules/mocha/bin/mocha: . I wonder why mocha is required in racer when I am trying to run tests for derby?

Secondly after I installed mocha in racer, I get following error

Cannot find module 'expect.js'

Even after doing `npm install expect` both inside derby and racer, I get the same error.

I also tried loading expect from mocha.opts. I got following error

/home/juzer/Desktop/Open-Source/derby/node_modules/racer/node_modules/expect/expect.js:17
  expect.version = '0.0.2';
  ^
ReferenceError: expect is not defined


Can somebody please guide me how can I run tests with derby. Tests with racer are running fine.

Pavel Zubkou

unread,
Nov 8, 2012, 3:20:35 AM11/8/12
to der...@googlegroups.com
Given that Derby is under "path" and Racer is under
"path/node_modules/racer" and tests from racer are running just fine,
simply call "./node_modules/racer/node_modules/mocha/bin/mocha" from
"path" to test Derby.

This assumes that racer's devDependencies were installed (which should
be because racer's tests runs).

mocha is required in racer because Derby's test suite is build on
racer's and racer already depends on mocha and expect.js
--
With best regards,
Pavel Zubkou.

Mobile: +375293851118
Skype: pavel.zubkou

Juzer Ali

unread,
Nov 8, 2012, 3:25:33 AM11/8/12
to der...@googlegroups.com
Racer tests runs when racer is cloned independently. But after installing racer via `npm install` from inside derby none of the tests runs. I get the error that expect is not defined. I tried requiring expect from mocha.opts, still no luck.
--
Regards,
Juzer Ali
--
http://about.me/juzerali

Carl-Johan Blomqvist

unread,
Nov 8, 2012, 3:41:35 AM11/8/12
to der...@googlegroups.com
Juzer, have you tried running 'npm install' inside your racer folder?

Juzer Ali

unread,
Nov 8, 2012, 7:03:52 AM11/8/12
to der...@googlegroups.com
I didn't know racer and derby are so tightly coupled. I did npm install in racer, still no luck.


On Thu, Nov 8, 2012 at 2:11 PM, Carl-Johan Blomqvist <carljohan...@gmail.com> wrote:
Juzer, have you tried running 'npm install' inside your racer folder?



Tyler Renelle

unread,
Nov 8, 2012, 12:21:03 PM11/8/12
to der...@googlegroups.com
`npm install` in racer should work. Make sure you're in node_modules/derby/node_modules/racer. The reason is mocha is installed as a devDependency, not a dependency (package.json) - and those are only installed when you're directly in that folder running `npm install`. devDependencies are for when you're actually developing that module, so you need test modules (mocha & expect.js), compilers (coffeescript), etc. Derby's Makefile just piggy-backs off Racer's devDependencies - if that's still giving you hell, you can just replace "./node_modules/racer/node_modules/mocha/bin/mocha" in Derby's package.json to "./node_modules/mocha/bin/mocha"
Reply all
Reply to author
Forward
0 new messages