Lessons learned testing React & Redux apps with Jest and Enzyme

Lessons learned #testing #reactjs  & #Redux #apps with #Jest and #Enzyme  #javascript

  • It makes things much easier, and you can pattern match (hit p then type part of your file/folder name) to make sure you’re not running a ton of things every save.Make sure you don’t close off your test() statements early.Parentheses man… 😢Is perfectly valid Javascript, but your test (while it…
  • I only noticed that I had this copy and pasted for one section of my unit tests when I made an error and realized the test didn’t fail.Which leads me to…Make sure your tests failIf you’re awesome and use TDD, then props to you you’re already doing this 🎉For the rest…
  • Time to move on.”However this leads to errors like the aforementioned one, and it’s surprisingly easy to grab and test the wrong element or mocked function — especially if you’re copy pasting from a similar test.It’s not hard to just comment out an essential section of a test and make sure it…
  • It’s also easy to copy to another component with a similar need for testing.In fact all of the little conventions I’m following here (beforeEach mounting a wrapper, what I name things, spreading a props object) are great to have defined somewhere so people can easily understand and copy test functionality…
  • It also makes testing quite simple and separates rendering vs data concernsI try to extract any complex data manipulation to pure functions and test thoseI use end to end (Selenium) and integration tests to check on sections of my app to make sure it all fits together.It’s not perfect, I’m…

If you don’t work at a primarily tech company, it can be a bit difficult to convince managers of the importance of things like unit testing. After being a enthusiastic supporter for quite a while, I…
Continue reading “Lessons learned testing React & Redux apps with Jest and Enzyme”

Path to React Native: From Rookie to Rockstar

We've put together a handy guide to help you master React & React Native quickly 🚀

  • We’re now able to build native apps for both iOS and Android platforms using pure JavaScript.
  • Once you’re familiar with the React basics, you’re actually equipped with all the knowledge necessary to build native mobile apps for iOS and Android.
  • We’ve been building apps with React and React Native for a while now and have been getting steadily more impressed with the way the ecosystem is developing.
  • Build Apps with React Native on Udemy is an 8-hour introduction to React Native that you can complete without needing any React.js knowledge.
  • Short and focused introductory videos: React Native Fundamentals on egghead.

Read the full article, click here.

@wearehanno: “We’ve put together a handy guide to help you master React & React Native quickly 🚀”

Building a hybrid mobile app seemed like a really big challenge just a few years ago. Unless you wanted to earn a reputation for building half-arsed and sluggish mobile app interfaces, you’d have been better off spending your time and money on proper (native) iOS or Android developers instead.

Path to React Native: From Rookie to Rockstar