Search code examples
ember.jsember-cliember-qunit

How to configure Ember 2.0 for Integration Testing


I created a sample ember-cli project using ember 1.13.5. I create one component and a dummy integration test. It runs just fine.

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

moduleForComponent('selected-product', 'Integration | Component | selected product', {
  integration: true
});

test('amount', function(assert) {
    assert.equal(100.00, 100.00);
});

I then update my ember version to 2.0.0-beta.3 in my bower.json file, run the tests, and receive an immediate error:

  1. TypeError: 'undefined' is not an object (evaluating 'Ember.View.extend')
  2. TypeError: 'undefined' is not an object (evaluating 'this.cache.subject')

There is literally nothing else custom in my projet. I just generated it. I realize it's beta software and not quite ready for primetime, but if anyone knows of a simple configuration change, I would appreciate it. I'm using ember-cli version 1.13.1.


Solution

  • You'll need to the latest version of ember-qunit, v.0.4.4 as of today, as ember-2.0.0-beta.3 compatibility was added in this commit. The version of ember-cli you are using does not come with this version of ember-qunit.