I'm planning on getting into writing tests for a while now. Thanks for showing multiple options of this testing library. It looks pretty handy, I would liko to see it with typescript though. What I didn't like, was the data attribute related to tests in the component itself.
One thing though. I feel like the examples use way too much explicit types. Some examples like isInvalidWord: boolean or onAddClicked: MouseEventHandler<HTMLButtonElement> feel absolutely unnecessary. Also the useRef can be used much simpler.
I hear ya.
I'm fairly new to TypeScript but not at all new to typed languages. I don't see declaring types as an optional choice. Either you're writing in a typed language or not. If you're using a typed language you should type anything which can be typed.
Nice simplification on the useRef() though ;)
Typescript should be a tool that helps you and not something that hinders you by wasting your time. Even languages like C++ now provide conveniences like auto type. By omitting some explicit types to let them be implicitly deduced or simplifying them you don't give up any type safety but save your time and make development faster.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm planning on getting into writing tests for a while now. Thanks for showing multiple options of this testing library. It looks pretty handy, I would liko to see it with typescript though. What I didn't like, was the
data
attribute related to tests in the component itself.One thing though. I feel like the examples use way too much explicit types. Some examples like
isInvalidWord: boolean
oronAddClicked: MouseEventHandler<HTMLButtonElement>
feel absolutely unnecessary. Also theuseRef
can be used much simpler.I hear ya.
I'm fairly new to TypeScript but not at all new to typed languages. I don't see declaring types as an optional choice. Either you're writing in a typed language or not. If you're using a typed language you should type anything which can be typed.
Nice simplification on the useRef() though ;)
Typescript should be a tool that helps you and not something that hinders you by wasting your time. Even languages like C++ now provide conveniences like
auto
type. By omitting some explicit types to let them be implicitly deduced or simplifying them you don't give up any type safety but save your time and make development faster.