jeudi 21 mars 2019

Ember.js - Acceptance tests UnrecognizedURLError: /tests

Having recently migrated Ember CLI from 2.15.0 to 3.7.0, the acceptance tests have regressed heavily. Having run the qunit codemod, the following issue seems to persist: UnrecognizedURLError: /tests.

I have produced a minimum reproduction of the issue via the following acceptance test:

import { module, test } from 'qunit';
import { visit, currentURL } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';


module('Acceptance | poc', function(hooks) {
  setupApplicationTest(hooks);
  setupMirage(hooks);

  test('visiting /poc', async function(assert) {
    await visit('/');

    assert.equal(currentURL(), '/');
  });
});


This results on the three following issues:

Promise rejected before "visiting /poc": /tests?filter=poc
Source:     UnrecognizedURLError: /tests?filter=poc 

beforeEach failed on visiting /poc: You must call one of the ember-qunit setupTest(), setupRenderingTest() or setupApplicationTest() methods before calling setupMirage()
Source:     Error: You must call one of the ember-qunit setupTest(), setupRenderingTest() or setupApplicationTest() methods before calling setupMirage()

Promise rejected after "visiting /poc": Cannot use 'in' operator to search for 'destroy' in undefined@ 80 ms
Source:     TypeError: Cannot use 'in' operator to search for 'destroy' in undefined

Any advice would be greatly appreciated!




Aucun commentaire:

Enregistrer un commentaire