2 ms·
Opinion: Although you can test hooks in isolation, I find they tend to be fairly primitive and testing them in combination with components can be more useful.
by steve_adams_86 5y ago
Opinion: Although you can test hooks in isolation, I find they tend to be fairly primitive and testing them in combination with components can be more useful.
In isolation, unless you have very complex hooks, it’s a bit like you’re testing react or JavaScript themselves. When testing a component which uses the hook, I find you get to test the behaviour and expectations a little better - it’s close to a real use case.