I personally believe that the assert.rejects example you gave above is what we want. I just need to figure out how to properly entangle the rendering related error with the promise returned from render…
Ember.onerror assertion throws if using your work-a-round:
Ember.onerror handler with invalid testing behavior detected. An Ember.onerror handler must rethrow exceptions when Ember.testing is true or the test suite is unreliable. See https://git.io/vbine for more details.
Seems like Ember.onerror must be reset afterwards to avoid leaking between tests:
module('my-component test', function(hooks) {
setupRenderingTest(hooks);
let orgOnError;
hooks.beforeEach(function() {
orgOnError = Ember.onerror;
});
hooks.afterEach(function() {
Ember.onerror = orgOnError;
});
test('throws', function(assert) {
Ember.onerror = function(error) {
// make your error assertion here
};
await render(hbs`{{my-component}}`)
});
});