Hem test fails with error cannot find module karma/adapter/lib/jasmine.js

344 views
Skip to first unread message

David Doran

unread,
Sep 23, 2013, 9:12:27 AM9/23/13
to spi...@googlegroups.com
Hi,

I've been using hem build and hem watch just fine, but can't get hem test to work.

When I run hem test I get the following output:

module.js:340
    throw err;
          ^
Error: Cannot find module '../node_modules/karma/adapter/lib/jasmine.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._compile.require.resolve (module.js:382:19)
    at Hem.createTestacularFileList (/usr/local/lib/node_modules/hem/lib/hem.js:321:27)
    at Hem.startTestacular (/usr/local/lib/node_modules/hem/lib/hem.js:314:21)
    at Hem.test (/usr/local/lib/node_modules/hem/lib/hem.js:206:19)
    at Hem.exec (/usr/local/lib/node_modules/hem/lib/hem.js:232:27)
    at Function.Hem.exec (/usr/local/lib/node_modules/hem/lib/hem.js:37:34)
    at Object.<anonymous> (/usr/local/lib/node_modules/hem/bin/hem:9:23)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

I have the following karma/jasmine related modules installed (and their dependencies etc):

├─┬ ka...@0.10.2 extraneous
├── karma-chro...@0.1.0
├── karma-...@0.1.3 extraneous
├─┬ karma-phanto...@0.1.0 extraneous


I can't find an example of a Spine.JS project on GitHub with tests so I'm not sure how to approach it.

Is there another package (or older package version) required?

Thanks,
David

Aaron Eischeid

unread,
Sep 23, 2013, 11:15:56 AM9/23/13
to spi...@googlegroups.com
what version of Hem are you using?

Aaron Eischeid

unread,
Sep 23, 2013, 11:23:03 AM9/23/13
to spi...@googlegroups.com
do the jasmine test page work for you? when hem is running in server mode you should be able to navigate to localhost:9294:/test (the defualt config anyway) and see a page that will run your jasmine tests.

David Doran

unread,
Sep 23, 2013, 11:24:18 AM9/23/13
to spi...@googlegroups.com
Hi Aaron,

I'm using hem version 0.3.4 (installed from GitHub repo).
Also tried 0.3.2, but same result.

Thanks,
David

David Doran

unread,
Sep 23, 2013, 12:02:04 PM9/23/13
to spi...@googlegroups.com
Hi Aaron,

Yes, the tests do actually work when launched from the browser. So that's a happy development.

-- Dave

Sean Blezard

unread,
Sep 29, 2013, 12:25:43 PM9/29/13
to spi...@googlegroups.com
Dave, did you get any further with understanding why hem test was failing at the command line? I'm finding the same.

Thanks,
Sean

Jonathan Langley

unread,
Nov 2, 2013, 9:28:36 AM11/2/13
to spi...@googlegroups.com
I came across this issue and found that a fix for this was made 18 days ago on Github if you are still having the same issue:
https://github.com/spine/hem/commit/1120efdf19a87ccb6368e84c046ed3600f501e34

To fix I had to remove HEM from the global:
npm remove -g hem

And then re-install from the git repo:
npm install -g git://github.com/spine/hem.git

Sean Blezard

unread,
Dec 21, 2013, 11:14:45 AM12/21/13
to spi...@googlegroups.com
Excellent - thanks for posting back to this thread.
Reply all
Reply to author
Forward
0 new messages