Quantcast
Viewing all articles
Browse latest Browse all 4828

Assertion Failed: A helper named 'my-component' could not be found

@haggis wrote:

Hello,

I've got an ember-cli app and try to test it the first time. The component was created with ember g component bs-slider.

When I run the tests (http://localhost:4200/tests) I get the following result:

Died on test #2     at Object.test (http://localhost:4200/assets/test-support.js:1984:11)
    at http://localhost:4200/assets/client.js:5732:15
    at mod.state (http://localhost:4200/assets/vendor.js:150:29)
    at tryFinally (http://localhost:4200/assets/vendor.js:30:14)
    at requireModule (http://localhost:4200/assets/vendor.js:148:5)
    at Object.TestLoader.require (http://localhost:4200/assets/test-loader.js:29:9)
    at Object.TestLoader.loadModules (http://localhost:4200/assets/test-loader.js:21:18): Assertion Failed: A helper named 'bs-slider' could not be found

Since I'm using pods the component files are located under app/pods/components/bs-slider/[component.js|template.hbs] The test file is located under tests/integration/pods/components/bs-slider/component-test.js with the following content (right from the blueprint):

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

moduleForComponent('bs-slider', 'Integration | Component | bs slider', {
  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`{{bs-slider}}`);

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

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

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

Is there anything I can do to tell the test framework where the component is located?

Kind regards haggis

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles