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.
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.