Skip to content

Changing ED imports to @ember-data brings model coverage to 0% #285

@rreckonerr

Description

@rreckonerr

Hi!
Changing ember-data imports brings models from 100% to 0% code coverage

Test

  test("exists", function(assert) {
    const model = run(() => this.owner.lookup("service:store").createRecord("some-model"));
    assert.ok(!!model);
  });

Before (100% code coverage)

import classic from "ember-classic-decorator";
import DS from "ember-data";

const { Model, attr, hasMany, belongsTo } = DS;

@classic
export default class SomeModel extends Model {
  @belongsTo
  one;

  @hasMany
  two;

  @attr("string")
  three;

  @attr
  chaChaCha;
}

After (0% code coverage)

import classic from "ember-classic-decorator";
import Model, { attr, hasMany, belongsTo } from "@ember-data/model";

@classic
export default class SomeModel extends Model {
  @belongsTo
  one;

  @hasMany
  two;

  @attr("string")
  three;

  @attr
  chaChaCha;
}

Is this an expected behavior?

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