Tests are the only thing that give me confidence about any code I write, Javascript or otherwise.
I've lost a stupid amount of time in regular JS because of things like this that make me want to pick up the computer and throw it out the window.
You're right that it's not independent from TS.