Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.1 KB

File metadata and controls

48 lines (35 loc) · 1.1 KB

remove-onerror-sinon-stubs

Usage

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 / Output


basic

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);
});