30 ms·
Sort of a side note but: this is one of the cool things about react. Testing dom structure and things like ids and classes becomes (practically) testing react i
by theyouker 12y ago
Sort of a side note but: this is one of the cool things about react. Testing dom structure and things like ids and classes becomes (practically) testing react itself and redundant. If you keep components simple and driven entirely by props and state (perferably as little state as possible), you only need to verify these things are what you'd expect them to be for the given state in the state machine that is your component. Its beautifully simple. You can even get a long way with tools like react-vdom where you don't actually render anything and just test the validity of your props. https://github.com/gcanti/react-vdom https://github.com/gcanti/react-vdom (I believe the author did tcomb...definitely also use jest though)