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

瀏覽次數:344 次
跳到第一則未讀訊息

David Doran

未讀,
2013年9月23日 上午9:12:272013/9/23
收件者: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

未讀,
2013年9月23日 上午11:15:562013/9/23
收件者:spi...@googlegroups.com
what version of Hem are you using?

Aaron Eischeid

未讀,
2013年9月23日 上午11:23:032013/9/23
收件者: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

未讀,
2013年9月23日 上午11:24:182013/9/23
收件者: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

未讀,
2013年9月23日 中午12:02:042013/9/23
收件者: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

未讀,
2013年9月29日 中午12:25:432013/9/29
收件者: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

未讀,
2013年11月2日 上午9:28:362013/11/2
收件者: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

未讀,
2013年12月21日 上午11:14:452013/12/21
收件者:spi...@googlegroups.com
Excellent - thanks for posting back to this thread.
回覆所有人
回覆作者
轉寄
0 則新訊息