jakearchibald / idb

IndexedDB, but with promises
https://www.npmjs.com/package/idb
ISC License
6.31k stars 356 forks source link

Automate type-test.ts #91

Closed NotWoods closed 5 years ago

NotWoods commented 5 years ago

Manually checking the test/type-test.ts file for problems is error-prone thanks to our poor human eyes. I added a script that will automate checking that certain lines in the test file have type errors. This also allows for CI to do the checking in the future.

I threw together a script to scan the output from tsc for errors for this project, but it ended up being big enough to stick in a separate package. Feel free to just copy over the code if you prefer.

jakearchibald commented 5 years ago

I agree that the manual test is bad, but I think I'm going to give https://github.com/Microsoft/dtslint a try.

If it doesn't work out, I'll merge this.

jakearchibald commented 5 years ago

…although I'm worried https://github.com/Microsoft/dtslint/issues/57 is going to hit hard.

jakearchibald commented 5 years ago

https://github.com/dsherret/conditional-type-checks is another option

jakearchibald commented 5 years ago

Actually, the latter seems much simpler and more versatile.

jakearchibald commented 5 years ago

My current plan is to merge the type tests with my regular tests.

NotWoods commented 5 years ago

Closing since conditional-type-checks seems like a great tool :smile: