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