cloudinary-community / cloudinary-util

https://cloudinary-util.vercel.app
MIT License
12 stars 10 forks source link

Chore: Migrate tests from JavaScript to TypeScript #173

Open nickytonline opened 3 weeks ago

nickytonline commented 3 weeks ago

While fixing #170, I was trying to get some type errors by putting invalid gravity values in the test suite until I realized they were written in JS.

Consider converting the test suites to TypeScript.

nickytonline commented 3 weeks ago

Happy to discuss/tackle this if you want to move forward with this.

colbyfayock commented 3 weeks ago

mixed feelings on this one. i dont love the idea of having to painstakingly define types for everything in the tests when tests can be a pain to get up and running sometimes in the first place. thinking about the extra loops someone would have to jump through sometimes to get this up and running

that said, thats an assumption and i haven't written tests in TS before, is that a fair assumption?

nickytonline commented 2 weeks ago

You shouldn't have to explicitly type a lot of things. Maybe some mock data would need to be cast sometimes where you don't have all the data that it actually expects.

I can do a little POC to show a before and after.

colbyfayock commented 2 weeks ago

id be down for a POC if you dont mind spending the time!

nickytonline commented 4 days ago

I'm still a little swamped at work, but can still look at this. That said if someone comes along before me, feel free to let them do the POC.