6 ms·
Thanks for the good read, very enlightening. But, I thought the choice of React as an example was interesting since it already provides test utilities. Any spec
by vkjv 11y ago
Thanks for the good read, very enlightening. But, I thought the choice of React as an example was interesting since it already provides test utilities. Any specific reason you aren't using these or were they just omitted for simplifying a blog post?
https://facebook.github.io/react/docs/test-utils.html https://facebook.github.io/react/docs/test-utils.html
- eterm 11y agoTest Utils with Shallow Rendering support were only added into react in 0.13, so perhaps these methods pre-date that? Test-Utils render into document require jsdom or similar to render into. It's easy to say "But 0.13 was ages ago", but in reality it was only released back in March, which may seem like an eternity to Hacker News, but in the real world isn't long at all, and not necessarily long enough for businesses to change their working practices if they already have other methods working well for them.
- lynndylanhurley 11y agoThe react test utils work in combination with jsdom. For example, TestUtils.renderIntoDocument will use jsdom as the document. There is a facebook-sponsored test framework called "jest" that is more akin to mocha or jasmine, but of those three frameworks it is the worst in my opinion. It's absurdly slow, poorly supported, and it mocks all imported/required modules by default which causes me more problems than it solves.