Skip to content

Latest commit

 

History

History
70 lines (52 loc) · 1.54 KB

File metadata and controls

70 lines (52 loc) · 1.54 KB

remove-sinon-usages

Usage

npx ember-sinon-sandbox-codemod remove-sinon-usages path/of/files/ or/some**/*glob.js

# or

yarn global add ember-sinon-sandbox-codemod
ember-sinon-sandbox-codemod remove-sinon-usages path/of/files/ or/some**/*glob.js

Input / Output


transform.sinon.to.sandbox

Input (transform.sinon.to.sandbox.input.js):

import { module, test } from 'qunit';

module('Unit | blah', function(hooks) {
  test('blah', function(assert) {
    assert.expect(1);

    let stub = sinon.stub().returns(true);
    let spy = sinon.spy();
    let clock = sinon.useFakeTimers();
    sinon.match({
      one: 1,
      two: 2,
      three: 3,
    });

    assert.ok(true);
  });
});

Output (transform.sinon.to.sandbox.input.js):

import { module, test } from 'qunit';

module('Unit | blah', function(hooks) {
  test('blah', function(assert) {
    assert.expect(1);

    let stub = this.sandbox.stub().returns(true);
    let spy = this.sandbox.spy();
    let clock = this.sandbox.useFakeTimers();
    this.sandbox.match({
      one: 1,
      two: 2,
      three: 3,
    });

    assert.ok(true);
  });
});