adopted-ember-addons / adopted-ember-addons/ember-data-model-fragments
Unit test failure using Mocha : Error: Assertion Failed: (subclass of DS.ModelFragment) does not appear to be an ember-data model
- Linguagem predominante
- TypeScript
- Estrelas
- 367
- Forks
- 108
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Using Ember-cli setup with mocha/chai as my test runner and assertions lib (using ember-cli-mocha), I have a simple model class looking like this :
models/Address.js
```
import DS from "ember-data";
export default DS.ModelFragment.extend({
civicNumber: DS.attr('number'),
streetName: DS.attr('string'),
city: DS.attr('string'),
provinceOrState: DS.attr('string'),
country: DS.attr('string'),
postalZipCode: DS.attr('string'),
building: DS.belongsTo('building', {embedded: 'always'})
});
```
With the following test code :
```
/* jshint expr:true */
import { expect } from 'chai';
import {
describeModel,
it
} from 'ember-mocha';
describeModel(
'address',
'Address',
{
// Specify the other units that are required for this test.
needs: []
},
function() {
// Replace this with your real tests.
it('exists', function() {
var model = this.subject();
// var store = this.store();
expect(model).to.be.ok;
});
}
);
```
Which fails with the following error :
not ok 14 PhantomJS 1.9 - Address exists
---
message: >
Assertion Failed: `(subclass of DS.ModelFragment)` does not appear to be an ember-data model
stack: >
Error: Assertion Failed: `(subclass of DS.ModelFragment)` does not appear to be an ember-data model
at http://localhost:7357/assets/vendor.js:14489
at http://localhost:7357/assets/vendor.js:74951
at http://localhost:7357/assets/vendor.js:73546
at http://localhost:7357/assets/test-support.js:2092
at http://localhost:7357/assets/vendor.js:10749
at run (http://localhost:7357/assets/vendor.js:27187)
at http://localhost:7357/assets/test-support.js:2093
at http://localhost:7357/assets/test-support.js:2299
at http://localhost:7357/assets/frontend.js:1104
at http://localhost:7357/assets/test-support.js:1686
at invoke (http://localhost:7357/assets/test-support.js:13702)
at http://localhost:7357/assets/test-support.js:13767
at http://localhost:7357/assets/test-support.js:7004
at http://localhost:7357/assets/test-support.js:7423
at http://localhost:7357/assets/test-support.js:7514
at next (http://localhost:7357/assets/test-support.js:7348)
at http://localhost:7357/assets/test-support.js:7358
at next (http://localhost:7357/assets/test-support.js:7297)
at http://localhost:7357/assets/test-support.js:7320
at done (http://localhost:7357/assets/test-support.js:6983)
at http://localhost:7357/assets/test-support.js:7003
at complete (http://localhost:7357/assets/test-support.js:13729)
at http://localhost:7357/assets/test-support.js:13707
at tryCatch (http://localhost:7357/assets/vendor.js:60990)
at invokeCallback (http://localhost:7357/assets/vendor.js:61002)
at publish (http://localhost:7357/assets/vendor.js:60973)
at http://localhost:7357/assets/vendor.js:39112
at http://localhost:7357/assets/vendor.js:11403
at http://localhost:7357/assets/vendor.js:11468
at http://localhost:7357/assets/vendor.js:11273
at http://localhost:7357/assets/vendor.js:10698
at http://localhost:7357/assets/vendor.js:11101
Log: >
...
Am I missing something or it's a real issue?
Any help will be highly appreciated!
Thanks
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.