reactjs / rackt-codemod

Codemod scripts for Rackt libraries
MIT License
40 stars 6 forks source link

Add Tests #6

Closed timdorr closed 8 years ago

timdorr commented 8 years ago

The purpose of each codemod is pretty opaque, so we can both test the modification and get some built-in examples if we're able to build out a test suite.

taion commented 8 years ago

Yup - @cpojer was on my case about this as well. We should take the scaffolding from his codemod repos, then use the changes to our tests as fixtures.

joshblack commented 8 years ago

I've had success running tests with the following structure: https://github.com/joshblack/codemods/tree/master/test just adding in folders for tests as developers make issues on the repo. Any thoughts? Would love to help contribute to this repo and adding tests seems like a good start.

timdorr commented 8 years ago

@joshblack Yeah, definitely! If you want to open a PR, that would be super duper helpful.

cpojer commented 8 years ago

The setup from https://github.com/reactjs/react-codemod can literally be copy and pasted. A bunch of other forks use the same structure, it would be nice to keep some sort of consistency.

joshblack commented 8 years ago

Sounds good, consistency is important.

joshblack commented 8 years ago

Do we have example project files that the mods were ran against that I can start filling the test cases out with?

taion commented 8 years ago

@joshblack The tests and examples on history and React Router, actually.

joshblack commented 8 years ago

Perfect, thanks for the heads up!

joshblack commented 8 years ago

Just wanted to give an update, currently working on this here: https://github.com/joshblack/rackt-codemod just have to add the history tests and I'll open up a PR.

cpojer commented 8 years ago

Awesome!