TypeError: Cannot read property 'reopen' of undefined
See original GitHub issueHey there,
I just upgraded to the latest ember-mocha
and can’t seem to shake the below error. I am running this test (setup outlined below) in the browser by visiting http://localhost:4200/tests
, and when I do, I can see that this test actually passes with a green checkmark, however, it is then followed by the below error message. It also seems to be intermittent, showing up about 6/10 times when I run the below test.
Error I see displaying in the UI right below my passing test:
X "after each" hook for "visits login page"
TypeError: Cannot read property 'reopen' of undefined
at Class.dropObject (<anonymous>:2956:18)
at Class.willDestroy (<anonymous>:2929:18)
at Class.superWrapper (assets/vendor.js:42349:28)
at invoke (assets/vendor.js:60112:24)
at Queue.flush (assets/vendor.js:60033:25)
at DeferredActionQueues.flush (assets/vendor.js:60185:31)
at Backburner._end (assets/vendor.js:60615:42)
at Backburner.end (assets/vendor.js:60418:18)
at Backburner._run (assets/vendor.js:60658:26)
at Backburner.run (assets/vendor.js:60453:25)
My current setup:
ember-cli: 3.7.1
ember-mocha: ^0.14.0
ember-cli-mocha: ^0.15.0
/tests/test-helper.js
import Application from '../app';
import config from '../config/environment';
import { setApplication } from '@ember/test-helpers';
setApplication(Application.create(config.APP));
/tests/acceptance/example-test.js
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupApplicationTest } from 'ember-mocha';
import { visit, currentURL } from '@ember/test-helpers';
describe('basic acceptance test', () => {
setupApplicationTest();
it('visits login page', async () => {
await visit('/login');
expect(currentURL()).to.equal('/login');
});
});
/app/config/environment.js
if (environment === 'test') {
// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.rootElement = '#ember-testing';
ENV.host = 'http://localhost';
ENV.APP.autoboot = false;
}
Have you seen this error pop up before? Does anything look incorrect with this current setup for running mocha tests in Ember with the new api? My tests were running as expected before the api update, and the tests are actually passing, seems like something is just getting messed up during tear town. Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
I’ve seen this a few times (most recently today). Restarting chrome resolved the issue.
Restarting chrome did it for me, thank you very much 😃) 👍