-
Notifications
You must be signed in to change notification settings - Fork 575
Write tests #9
Comments
I wouldn't have released a v1.0 without tests. |
I agree that having tests would have been great, but when deciding between keeping this closed source and open-sourcing without tests, we decided for the latter one. You're more than welcome to contribute some tests @stevenvachon 🙂 |
I've gone back and forth a lot on this, and eventually landed on functional tests vs unit. Once you start mocking the CDP module it gets pretty hairy and unmaintainable quickly (since it's an extremely wide API). Would be curios to hear others' opinions. |
+1 for the bulk of the tests being functional. Due to the nature of this library, unit tests wouldn't give me a ton of confidence that everything works properly. |
I just noticed this thread. I ended up covering with mostly unti tests to start without mostly to learn the code base. See #188. I'll admit it's kind of messy, but hopefully it's a good start. I was kind of bouncing all over the place as I learned how each class is used (and using TypeScript for the first time). I think the unti tests come in handy for a sanity check. As I was writing the tests I found a few spots where a method wasn't being called, i.e. Having said that, I think functional tests will be very necessary. In the real world, it doesn't always be have as expected in unit tests, or the call to CDP isn't quite right, etc. I think writing out some known HTML with form inputs, missing selectors, etc. would be helpful to test against, and serve that up locally and/or reference them on Github. Thoughts on this? |
No description provided.
The text was updated successfully, but these errors were encountered: