emberjs / emberjs/ember-qunit

Test isolation validation not working

Open
#941 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
258
Forks
156
PR merge metrics
No merged PRs in 30d

Description

Based on the [test isolation validation documentation](https://github.com/emberjs/ember-qunit/blob/master/docs/TEST_ISOLATION_VALIDATION.md) I adjusted the Super Rental example to contain a test that should trigger the validation - but it won't (code can be found [here](https://github.com/tsagadar/super-rentals/commit/53a21dcedf0ce84828ae6ba36423139c056a6f35)).

Turns out that test execution is done with `waitForSettled = true`. As a result, the isolation validation at the end of each test will never check for problems:
```
test.finish = function () {
let doFinish = () => finish.apply(this, arguments);

if (isSettled()) {
return doFinish(); // <--- always ends up here
} else {
... // <--- here the validation would happen
}
```
Setting `waitForSettled = false` in `setupTestIsolationValidation` has no effect as it is done too late - `start` already initialised all the tests and set `waitForSettled = true` in the qunit context.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.