sikanhe / reason-nodejs

Node bindings for Reason and Bucklescript
MIT License
100 stars 18 forks source link

Testing needed #15

Open austindd opened 4 years ago

austindd commented 4 years ago

We need more tests. This issue exists to clarify the testing goals of the project and give future contributors an idea of what we want to see in the test suite.

Goals:

  1. Ensure the type bindings are mostly accurate and sound.
  2. Reduce the likelihood for bugs, both at compile-time and at runtime.
  3. Make sure functions are called/applied correctly.
  4. Increase the overall quality of the library.
  5. Keep track of breaking changes (once this library is officially stable).

Non-goals:

  1. 100% type correctness -- Node's API was designed many years ago with JS developer ergonomics in mind. Therefore, many of its functions are highly polymorphic and dynamic when it comes to types. It is not possible to perfectly model everything in Reason's type system, and we have no desire to do so.
  2. 100% API coverage -- Some things are hard to test. Some things aren't worth testing due to sheer complexity, such as isolating test code from external factors. Much of Node is focused on IO operations, which are notoriously difficult to test. We won't sweat over it. Nor should you.
  3. Test the underlying functionality of Node -- Node has their own internally-maintained test suite that they use for development. They got it covered.

With those ideas in mind, we invite anyone and everyone to contribute to the test suite. Just submit a PR and we will be happy to integrate it if it meets our testing goals.

This is also a great way for Reason beginners to contribute to the ecosystem!