sunwrobert / ember-sinon-qunit-codemod

codemod to migrate to ember-sinon-qunit V4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ember-sinon-qunit-codemod

A jscodeshift based codemod to help migrate to ember-sinon-qunit V4.

This codemod converts usages of this.sandbox to sinon, and removes usages of ember-sinon-sandbox and ember-sinon-sinoff. Lastly, it will remove usages of sinon.restore as it is not needed in V4.

Usage

WARNING: jscodeshift, and thus this codemod, edits your files in place. It does not make a copy. Make sure your code is checked into a source control repository like Git and that you have no outstanding changes to commit before running this tool.

cd my-ember-app-or-addon
npx ember-sinon-qunit-codemod tests

Make sure to remove any deprecated libraries, such as ember-sinon-sandbox or ember-sinon-sinoff and then use the latest ember-sinon-qunit

npm i -D ember-sinon-qunit

Gotchas

Keep in mind that this codemod may end up leaving unwanted whitespace when importing sinon. This can be autofixed with a proper eslint rule.

About

codemod to migrate to ember-sinon-qunit V4


Languages

Language:JavaScript 70.0%Language:TypeScript 30.0%