by jondubois · 7y ago · 0 comments
You don't need to do type assertions with JavaScript; in the tests you may need to assert that certain properties exist but only to the extent that this property is relevant to the test case. This is purely a logic concern, not a typing concerns.
Types are just labels which try to make sense of reality so it makes no sense to assert their correctness.
Any project of size will need types. Either they will be explicit (static typing) or the project will be riddled comments, tests, assertions, and bugs.
You can eliminate a whole group of tests in TS that you would otherwise need in a JS project.