Bitcoin-com / bitbox-sdk

BITBOX SDK for Bitcoin Cash
https://developer.bitcoin.com/bitbox
MIT License
88 stars 62 forks source link

Convert unit tests from TS to JS #164

Open christroutner opened 4 years ago

christroutner commented 4 years ago

There are issues with using TS to write unit tests. Here is an example of why unit tests should be written in JS:

I couldn't write a test-case to test the error handling if a user passes a string in place of an integer, because that test case invalidates the typings in TS. But the fact is that anyone can import the bitbox-sdk library into a JS project and they can accidentally pass a string in place of an integer.

So here is a case in which we can't even write a test because of TS, to catch a very real use case.