I'm not sure if all those string literals would make things harder for typescript users.
expect(handleClick, 'was not called') vs expect(handleClick).not.toBeCalled() for me as a typescript user, the latter is not only more readable (it reads more like a sentence), but I can write faster as I get comprehensive type hinting...
That is true. The editor will also help write tests faster but I still prefer the plain english syntax of UnexpectedJS. In that case all assertion strings are colored the same and that is easy for me to read as the eye doesn't need to jump.
Another thing I prefer is creating custom assertions to make things even more clear and less wordy.
@jackmellis do you use React Testing Library at Claimer?
We do, extensively. Having said that, we split our components based on how dumb they are. Something like a button wouldn't have any "tests", in preference of automated visual tests using something like Percy, Chromatic, Backstop, etc. 😁
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 not sure if all those string literals would make things harder for typescript users.
expect(handleClick, 'was not called')
vsexpect(handleClick).not.toBeCalled()
for me as a typescript user, the latter is not only more readable (it reads more like a sentence), but I can write faster as I get comprehensive type hinting...That is true. The editor will also help write tests faster but I still prefer the plain english syntax of UnexpectedJS. In that case all assertion strings are colored the same and that is easy for me to read as the eye doesn't need to jump.
Another thing I prefer is creating custom assertions to make things even more clear and less wordy.
@jackmellis do you use React Testing Library at Claimer?
We do, extensively. Having said that, we split our components based on how dumb they are. Something like a button wouldn't have any "tests", in preference of automated visual tests using something like Percy, Chromatic, Backstop, etc. 😁