Skip to content

How to unit test a model using PartialModel extension? #30

@bsaff

Description

@bsaff

After extending my model, call it car, from PartialModel I can't run ember unit test. Tests fail with the following error:

No model was found for 'car-extended'

Tried including in unit test dependency like so:

import { moduleForModel, test } from 'ember-qunit';

moduleForModel('car', 'Unit | Model | car', {
  // Specify the other units that are required for this test.
 needs: ['model:car-extended']
});

test('it exists', function(assert) {
  var model = this.subject();
  // var store = this.store();
  assert.ok(!!model);
});

but that doesn't work either.

Any suggestions on how to get unit tests working?

Model def:

import DS from 'ember-data';

import { PartialModel, partial } from 'ember-data-partial-model/utils/model';

export default PartialModel.extend({

  name: DS.attr(),

  extended: partial('car', 'extended', {
    status: DS.attr('string'),
  }),

});

versions:
"ember-data": "2.13",
"ember-data-partial-model": "0.4.0",
"ember-source": "~2.15.0",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions