npx ember-test-onerror-codemod remove-onerror-assignments path/of/files/ or/some**/*glob.js
# or
yarn global add ember-test-onerror-codemod
ember-test-onerror-codemod remove-onerror-assignments path/of/files/ or/some**/*glob.js
Input (basic.input.js):
test('foo test', async function (assert) {
assert.expect(1);
Ember.onerror = function() {};
Ember.onerror = () => {};
Ember.onerror = fn;
});
Output (basic.output.js):
test('foo test', async function (assert) {
assert.expect(1);
setupOnerror(function() {});
setupOnerror(() => {});
setupOnerror(fn);
});