Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sinon codemod #242

Merged
merged 4 commits into from Apr 11, 2022
Merged

Add sinon codemod #242

merged 4 commits into from Apr 11, 2022

Conversation

catc
Copy link
Contributor

@catc catc commented Apr 6, 2022

This is the first pass at a sinon codemod - see relevant thread. We've used this on our codebase to help migrate ~80% (1800+ files) of sinon use cases.

Thanks to @jordalgo for the initial POC.

cc @lencioni @danbeam

@skovhus
Copy link
Owner

skovhus commented Apr 7, 2022

This is awesome. Would you mind updating the README. I also believe we have a warning if we see sinon mocks, that should be changed to suggest using the transformer. Depending on the stability of it we might consider including it as a default transformer.

@catc
Copy link
Contributor Author

catc commented Apr 7, 2022

@skovhus updated both README + warning

@@ -10,7 +10,8 @@ Codemods that simplify migrating JavaScript and TypeScript test files from
[Mocha](https://github.com/mochajs/mocha),
[proxyquire](https://github.com/thlorenz/proxyquire),
[Should.js](https://github.com/tj/should.js/),
[Tape](https://github.com/substack/tape)
[Tape](https://github.com/substack/tape),
[Sinon](https://github.com/sinonjs/),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update the “ Usage (jscodeshift)” section?

we should also add sinon to the cli. Let me know if you need any help doing that. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated both

Copy link
Owner

@skovhus skovhus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Thanks for fixing this. 👏

@skovhus skovhus merged commit 47a8124 into skovhus:master Apr 11, 2022
@jordalgo
Copy link

+1 Great stuff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants