emberjs / emberjs/ember-mocha

Component tests run fine if in the 'root' describe block, but throw 'You have turned on testing mode, which disabled the run-loop's autorun' error when in nested describe blocks

Open
#132 15 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
130
Forks
62
PR merge metrics
No merged PRs in 30d

Description

The following pseudo code works fine:

```js
describe('Unit | Component | common | input-with-validation', function() {
setupComponentTest('componentToTest', {
needs: [],
unit: true
});
beforeEach(function () {
component = this.subject();
});

it('Test Observer', function() {
component.set('observedKey', true);
}
}
```

but the following does not, and raises an assertion error: `You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in a run`

```js
describe('Unit | Component | common | input-with-validation', function() {
setupComponentTest('componentToTest', {
needs: [],
unit: true
});

beforeEach(function () {
component = this.subject();
});

describe('Observers', function () {
it('Test Observer', function() {
component.set('observedKey', true);
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.