jeudi 18 octobre 2018

ember-mocha: Rendering tests for component never gets called

I'm trying to setup some simple BDD tests for an ember project using ember-mocha. I've been following the sample shown in the documentation however the callback that I pass to it() is never called:

import { render } from '@ember/test-helpers'
import { expect } from 'chai'
import { setupRenderingTest } from 'ember-mocha'
import hbs from 'htmlbars-inline-precompile'
import { describe, it } from 'mocha'

describe('UIButtonComponent', () => {

  // debugger // <-- breakpoint is hit if comment removed

  setupRenderingTest()

  it('renders text label', async () => {

    debugger // <-- breakpoint never hit

    await render(hbs`<UiButton @text=test />`)

    expect(this.element.querySelector('img')).to.exist
  })
})

The callback passed to describe() is called, however my actual test never runs. Running the test produces this error in the web based test runner:

enter image description here

Any help would be greatly appreciated!




Aucun commentaire:

Enregistrer un commentaire