samedi 19 décembre 2015

Ember-cli default integration tests always fail with parse error

The default integration tests in ember-cli always fail with an error of "Parse error". For example if I have a default integration test like so:

import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('campfire-video', 'Integration | Component | campfire video', {
  integration: true
});

test('it renders', function(assert) {
  assert.expect(2);

  // Set any properties with this.set('myProperty', 'value');
  // Handle any actions with this.on('myAction', function(val) { ... });

  this.render(hbs`{{campfire-video}}`);

  assert.equal(this.$().text(), '');

  // Template block usage:
  this.render(hbs`
    {{#campfire-video}}
      template block text
    {{/campfire-video}}
  `);

  assert.equal(this.$().text().trim(), 'template block text');
});

where the component has no template file and the JS looks like the following:

export default Ember.Component.extend({
  attributeBindings: ['autoplay', 'controls', 'loop', 'muted', 'poster', 'src'],
  classNames: ['campfire', 'video'],
  tagName: 'video'
});

I will always get this error. I have tried upgrading ember-cli-htmlbars-inline-precompile but it does not fix the error. Is there anything I am doing wrong or is there a problem with ember-cli?




Aucun commentaire:

Enregistrer un commentaire