samedi 28 mars 2015

ember-cli 0.2.1 - generated addon test cannot find mixin

I have recently upgraded ember-cli 0.2.0 to 0.2.1 and I ran the following command to generate a mixin:



ember g mixin listener


The generate file was place in addon/mixins/listener.js.


The generated test looks like this:



import Ember from 'ember';
import ListenerMixin from '../../../mixins/listener';
import { module, test } from 'qunit';

module('ListenerMixin');

// Replace this with your real tests.
test('it works', function(assert) {
var ListenerObject = Ember.Object.extend(ListenerMixin);
var subject = ListenerObject.create();
assert.ok(subject);
});


The test fails with the following error message:



Could not find module dummy/mixins/listener imported from dummy/tests/unit/mixins/listener-test



My mixins should be in /addons/ and not /app/


What do I need to change for the tests to find the module?


When I upgraded from 0.2.0 to 0.2.1 I followed the docs for upgrading and ran all the steps in the docs


but this line:



ember init


Returned this error which I assume is something to do with it:



Generating an addon in an existing ember-cli project is not supported.






Aucun commentaire:

Enregistrer un commentaire