karma-runner / karma-qunit

A Karma plugin. Adapter for QUnit testing framework.
MIT License
51 stars 38 forks source link

qunit-fixture is not reset between tests properly #104

Closed asapach closed 6 years ago

asapach commented 6 years ago

93 broke some of our tests which relied on the previous behavior of #qunit-fixture being reset on testStart by the adapter.

The tests basically do this:

QUnit.module("Test suite", {
    beforeEach: function () {
        $("#qunit-fixture").append(fixtures);
    }
});

The problem seems to be that QUnit begin handler runs before the adapter begin handler, which means that QUnit is not able to store QUnit.config.fixture element, because it's not created yet. So the #qunit-fixture element is not restored properly.

Here's the repro: https://github.com/asapach/karma-qunit-fixture

@Krinkle, could you please take a look?

asapach commented 6 years ago

Created a PR to fix this: #106