Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ownerInjection leads to error in service unittest #18740

Closed
jnfingerle opened this issue Feb 12, 2020 · 0 comments · Fixed by #18780
Closed

ownerInjection leads to error in service unittest #18740

jnfingerle opened this issue Feb 12, 2020 · 0 comments · Fixed by #18780

Comments

@jnfingerle
Copy link

Hi,

I've got a problem in a big-ish older code base. My minimal test case is this (with a classic class Service):

  test('create with owner (Error)', function(assert) {
    let service = Service.create(this.owner.ownerInjection());
    assert.ok(service);
  });

see https://github.com/jnfingerle/test-addon-ownerinjection/commit/a005a1204f8b6bde619825a187504b8d91cffd89

This leads to an error with the message

Error: Assertion Failed: An EmberObject based class, (unknown), was not instantiated correctly. You may have either used `new` instead of `.create()`, or not passed arguments to your call to super in the constructor: `super(...arguments)`. If you are trying to use `new`, consider using native classes without extending from EmberObject.

I don't know what I did wrong ...

Cheers,
Jan Niklas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant