-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Description
I made tests a bit too verbose in #11616.
Might be a good time to revisit how we write them now.
There's a few separate issues:
-
Asserting on warning messages is too verbose. Need a DEV block, call
spyOnDev, normalize stack, etc. Ideally I wish there was a higher level helper that lets us "push" expected warning assertions and validate them as they happen. It should handle component stacks automatically without having to copy-paste the normalization helper everywhere. -
In some cases I added actual duplication in Run Jest in production mode #11616, in particular for cases that throw in development but don't throw in production. Maybe need a
toThrowInDev()? Although on the other hand this pattern needs to be highly visible so maybe extracting common code in a closure is good enough.