ember.js - ember-cli 0.2.1 - generated addon test cannot find mixin -
i have upgraded ember-cli 0.2.0 0.2.1 , ran following command generate mixin:
ember g mixin listener
the generate file place in addon/mixins/listener.js
.
the generated test looks this:
import ember 'ember'; import listenermixin '../../../mixins/listener'; import { module, test } 'qunit'; module('listenermixin'); // replace real tests. test('it works', function(assert) { var listenerobject = ember.object.extend(listenermixin); var subject = listenerobject.create(); assert.ok(subject); });
the test fails following error message:
could not find module
dummy/mixins/listener
importeddummy/tests/unit/mixins/listener-test
my mixins should in /addons/
, not /app/
what need change tests find module?
when upgraded 0.2.0 0.2.1 followed docs upgrading , ran steps in docs
but line:
ember init
returned error assume it:
generating addon in existing ember-cli project not supported.
i ran issue on ember-cli 0.2.3 , appears resolver still has problem mixins part of addon. solved replacing ember-cli's default:
import mymixin '../../../mixins/my-mixin';
to ...
import mymixin '[addon-name]/mixins/my-mixin';
works me. hope works too.
Comments
Post a Comment