question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

The following pseudo code works fine:

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

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);
    }
  }
}

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:3
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Jan 31, 2017

I just reproduced this in our app. Here is an example test that reproduces the error: https://github.com/efx/ember-mocha/commit/560abc959fe70abd8baf8313eeecb055117aebe0

1reaction
ghostcommented, Jun 1, 2020

@rreckonerr I deleted my fork and that work; apologies! I will take a look later today to see if I have a copy locally. I reduced the example to the most basic form. You should be able to see the issue by simply nesting the 2nd describe in the first one. For the record, our team avoids nesting describe blocks in our ember application because of this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't nested describe() blocks see vars defined in outer ...
The body of a describe block is executed before the beforeEach blocks. This is exactly as expected. The problem is that your var...
Read more >
Changelog - Cypress Documentation
In Cypress 12, we enforce running tests in a clean browser context through test isolation. This option is configurable, but is enabled by...
Read more >
Vitis Unified Software Platform Documentation | Xilinx
The hardware component, or kernel, can be developed using. C/C++, OpenCL C, or RTL. The Vitis software platform promotes concurrent development and test...
Read more >
doc - Apple Open Source
According to the ES6 spec if a user tries to get, set, or define a property on a neutered TypedArray we should throw...
Read more >
mozilla-release: changeset 469211 ...
devtools/client/debugger/new/test/mochitest/browser_dbg-expressions-error.js ... If a copy of the MPL was not distributed with this * file, You can obtain ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found