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