I am trying to test my code in Ember.js. However when I run ember test --filter="my-test", I get No tests were run, please check whether any errors occurred in the page (ember test --server) and ensure that you have a test launcher (e.g. PhantomJS) enabled.
I am using Ember 2.7.0, node 4.4.7, and OS darwin x64.
In fact, my project structure is somewhat complex.
I have multiple projects, A, B and C. Because project B and C have a lots of similar code, I made A an addon, B and C are just normal projects. By doing that I can reuse my code written in A because all of them will be copied into B and C.
When I run ember s, I run under B directory. Everything works fine.
Now suppose I want to test a component written in A, called nav-bar. And my test is my-test.js
I ran ember test --filter="my-test" under B directory. Then I got No tests were run error.
If I run it under A directory, I got
Error: Version "0.1.2" not compatible with "^0.1.3"
at Object.<anonymous> (/Users/jc/workspace/repo/isnc/A/node_modules/ember-g-map/node_modules/ember-cli-htmlbars/node_modules/broccoli-persistent-filter/node_modules/heimdalljs/index.js:12:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/jc/workspace/repo/isnc/A/node_modules/ember-g-map/node_modules/ember-cli-htmlbars/node_modules/broccoli-persistent-filter/node_modules/heimdalljs-logger/dist/index.js:9:32)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/jc/workspace/repo/isnc/A/node_modules/ember-g-map/node_modules/ember-cli-htmlbars/node_modules/broccoli-persistent-filter/index.js:11:22)
at Module._compile (module.js:409:26)
How can I get my test to work? thank you.
Aucun commentaire:
Enregistrer un commentaire