Learn Redux by coding a Mini-Redux – Jakob Lind

Do you think Redux is complicated? Learn Redux by coding your own mini-redux  #reactjs

  • The whole point with Redux is to have one single source of truth for your application state.
  • The state is stored as a plain Javascript object in one place: the Redux Store.
  • When Redux is used with React, it is the React components that get notified when state changes, and can re-render based on new content in the store.
  • We can copy/paste that example to test our own Redux implementation: – – Get the full code to run it on your machine by signing up to my email list below!
  • In the next blogpost, we will code the connect function which binds your Redux store to React components.

There are lots of resources for learning Redux. There is the official documentation, examples, tutorials, blog posts, boilerplates, Youtube videos, podcasts, etc… The list goes on. Even though we have so many great resources to learn from, new developers coming in still sometimes gets confused. It’s an overwhelming amount of content and it can be difficult to filter out the relevant stuff.
Continue reading “Learn Redux by coding a Mini-Redux – Jakob Lind”

Testing in React Native — Jest & Detox – Pillow.codes

Testing in React Native  with  Jest & Detox

#ReactJS #Jest

  • Testing can help identify bugs introduced during the development phase of the app and addressing these bugs before release means that your users will always get to use a reliable product.What kind of tests can we use?Unit tests are used to test small modular pieces of code (aka units) independently.Integration tests…
  • One of my favorite things about Jest is a feature called Snapshot testing.Snapshot tests are a very useful tool whenever you want to make sure the UI for a component or the object from an redux action or reducer does not change unexpectedly.Here’s a good explanation of what a snapshot…
  • Here’s a simple example on how to set this up.Jest tests for Pillow Pro appE2E tests: DetoxAn end-to-end test emulates a user by finding and interacting with pieces of UI in your app in a production/release environment.Detox is a gray box E2E Tests and Automation Library for Mobile Apps built by WixWe…
  • Here’s how we handle them in Detox:LoginHere’s a simple example of what a detox test for logging into the app might look like:DemoAnd finally, here’s a part of our E2E test suite in action.
  • Also, automating the tests on Bitrise CI has helped us streamline our release pipeline by preceding every release with the tests workflow.Hopefully, this post details how easy it is to test a React Native app and automate the testing process as well.

At Pillow, we release an update to our Pillow Pro app (iOS & Android) every 2 weeks or so. Most releases are over-the-air (OTA) updates that are done using CodePush, and are fully automated with…
Continue reading “Testing in React Native — Jest & Detox – Pillow.codes”