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”

Learning React Native: where to start – Hacker Noon

Learning React Native: where to start @Kelset  #Reactjs #ReactNative #JavaScript

  • If you are reading these lines, chances are you will fall into one of two categories:You are a React Native developer, looking for a fast list of resources to send to that new colleague of yours you have to introduce to the frameworkYou are the guy who actually received the link, and you need to learn React Native by yourself asapIn both cases, welcome!
  • I’m writing this post for this exact reason — and mainly because I needed it myself this morning and I wasn’t able to find one that satisfied me.React Native is an awesome open source framework, that uses Javascript to let you create — without too much effort — Android and iOS applications at once.
  • So, what should you do to learn it properly?STEP 0: Install itPretty straightforward, the first task you have to face is to install it properly: it may sound simple, but trust me it is a long process: head over to the official docs to learn how.BTW, if you are on Windows and you can’t find a way to make it work, check this blogpost from the guys at Infinite Red — which have created one of the best React Native starter kit out there, Ignite.STEP 1: Get the right equipmentSimply enough, next step is to install an IDE (Integrated development environment) that will allow you to write React Native code flawlessly, providing a set of additional tools to help you out.If you are planning to write code only for React Native, you should consider DECO, which is scoped for RN devs.For the other 99% of us, the choice will be between (to list the most famous) Sublime Text 3, Atom and Visual Studio Code.
  • I personally suggest you to follow the guide franzejr wrote about it.STEP 2: Read React Native ExpressPlain and simple, React Native Express is the best (imho) guide to learn Javascript to write React Native right now.It is quite complete, starting from plain Javascript to get to complex topics like state management via Redux and Animations.
  • And it’s completely Open Source.STEP 3: Learn React NavigationIf you are reading these lines, it means that you are so lucky (seriously, I envy you) to be learning React Native at a time when there is the official React Navigator.For a really long time, navigation in React Native was really hard to handle: there were many different navigators (the first one, Experimental, ExNav) and it was quite difficult to learn properly how to use them, let alone integrate them with Redux or MobX.But now, things are different: so go, read those amazing docs and follow the getting started guide to learn how to make multi-page applications.STEP 4: Dive into the frameworkOnce you got a good grasp of React Native, it’s time to get you up to speed: as you may have heard, we are not yet to a 1.

In both cases, welcome! I’m writing this post for this exact reason — and mainly because I needed it myself this morning and I wasn’t able to find one that satisfied me. React Native is an awesome…
Continue reading “Learning React Native: where to start – Hacker Noon”

Learning React Native: where to start – Lorenzo Sciandra – Medium

Learning React Native: where to start  #reactnative #react #learning #reactjs

  • If you are reading these lines, chances are you will fall into one of two categories:You are a React Native developer, looking for a fast list of resources to send to that new colleague of yours you have to introduce to the frameworkYou are the guy who actually received the link, and you need to learn React Native by yourself asapIn both cases, welcome!
  • I’m writing this post for this exact reason — and mainly because I needed it myself this morning and I wasn’t able to find one that satisfied me.React Native is an awesome open source framework, that uses Javascript to let you create — without too much effort — Android and iOS applications at once.
  • So, what should you do to learn it properly?STEP 0: Install itPretty straightforward, the first task you have to face is to install it properly: it may sound simple, but trust me it is a long process: head over to the official docs to learn how.BTW, if you are on Windows and you can’t find a way to make it work, check this blogpost from the guys at Infinite Red — which have created one of the best React Native starter kit out there, Ignite.STEP 1: Get the right equipmentSimply enough, next step is to install an IDE (Integrated development environment) that will allow you to write React Native code flawlessly, providing a set of additional tools to help you out.If you are planning to write code only for React Native, you should consider DECO, which is scoped for RN devs.For the other 99% of us, the choice will be between (to list the most famous) Sublime Text 3, Atom and Visual Studio Code.
  • I personally suggest you to follow the guide franzejr wrote about it.STEP 2: Read React Native ExpressPlain and simple, React Native Express is the best (imho) guide to learn Javascript to write React Native right now.It is quite complete, starting from plain Javascript to get to complex topics like state management via Redux and Animations.
  • And it’s completely Open Source.STEP 3: Learn React NavigationIf you are reading these lines, it means that you are so lucky (seriously, I envy you) to be learning React Native at a time when there is the official React Navigator.For a really long time, navigation in React Native was really hard to handle: there were many different navigators (the first one, Experimental, ExNav) and it was quite difficult to learn properly how to use them, let alone integrate them with Redux or MobX.But now, things are different: so go, read those amazing docs and follow the getting started guide to learn how to make multi-page applications.STEP 4: Dive into the frameworkOnce you got a good grasp of React Native, it’s time to get you up to speed: as you may have heard, we are not yet to a 1.

In both cases, welcome! I’m writing this post for this exact reason — and mainly because I needed it myself this morning and I wasn’t able to find one that satisfied me. React Native is an awesome…
Continue reading “Learning React Native: where to start – Lorenzo Sciandra – Medium”