Closed workmanw closed 7 years ago
I have thoughts...
I'd prefer to avoid clobbering Ember.Test.adapter
, lets make ember-qunit expose an override to make this a bit simpler?
so we could do:
import { setAdapterExceptionHandler } from 'ember-qunit';
// ... snip ...
QUnit.assert.expectAssertion = function() {
let lastError;
setAdapterExceptionHandler((error) => lastError = error);
// snip rest of code
};
@workmanw - Thoughts?
@rwjblue Yea, that works for me. We also need a way to remove or reset that exception handlers? I'd be happy to submit a PR to ember-qunit
.
EDIT: Actually I guess we could just do setAdapterExceptionHandler(null);
to reset it.
I was thinking null
for reset, yes
@rwjblue Do you have any objection to me cutting a release with this PR. Then immediately working on setAdapterExceptionHandler
? I'm looking to provide relief for the issue discussed in: https://github.com/emberjs/ember.js/pull/14898
nope, no objections. The thing I'm suggesting above is really just another iteration forward...
Excellent. Thanks for the feedback and direction. I'll submit PRs to make this happen.
This is to handle assertions thrown inside of a runloop during an integration test. Related to: https://github.com/emberjs/ember.js/pull/14898 .