How to do end-to-end testing on React Native with Detox

  • They are being performed on matched elements.Expect verifies if a certain value is as expected to be.As we can see detox covers a lot of possible user interactions that can be automated.Make our tests more readableTo be honest, we can do much better.First let’s get rid of the duplication for matchers…
  • Automate the process and land on the moon 🚀Once we reached a certain amount of tests, we thought it could be nice to automate the process and think in terms of “continuous testing”.
  • That’s why we decided to run the end-to-end test on our build server.Every new pull request that comes in, triggers unit tests with Jest on CircleCI and now also our end-to-end tests on Bitrise (our build server).
  • This is mostly due to the Detox build scripts.AlternativesWe also considered others libraries such as:Appium which is a cross platform test library where tests can be written in many languages (node, ruby, java, … ).
  • Hence, our choice of using Detox.ConclusionIn this article we saw how to handle Detox and its API, how to automate everything with Bitrise (or any CI that can runs an IOS Simulator).

When we started writing our React-Native app at Home, testing was something we took seriously from day one. While it was easy to setup a proper unit-tests workflow with Jest and Typescript, we figure…
Continue reading “How to do end-to-end testing on React Native with Detox”

Facebook Relents on React.js License Issue via @InfoSecHotSpot

Facebook Relents on React.js License Issue  via @InfoSecHotSpot

  • Well, it’s safe to use code from Facebook’s React.js library in open source projects.
  • At issue is a license Facebook created by taking an existing open source license, modifying it with a short patent caveat, then calling it the BSD+Patents license.
  • The issue was with the patent clause Facebook had added to the license, which states that anyone using the code, directly or indirectly, cannot take legal action against Facebook for any patent infringement involving any software without losing the right to use and distribute the code.
  • The problem wasn’t with patent protections: Many open source licenses, including Apache, have patent clauses preventing users from suing over any patents the covered software might infringe, but Facebook’s license seeks to protect the company from infringement by any and all of its software.
  • Then on Friday, Facebook’s engineering director, Adam Wolff, announced in a blog post, “Next week, we are going to relicense our open source projects React, Jest, Flow, and Immutable.js under the MIT license.

It’s safe to go back in the water again. Well, it’s safe to use code from Facebook’s React.js library in open source projects. The folks at the social site have done an about-face and will be changing React.js’s license to MIT, along with the licenses for Jest, Flow and Immutable.js. The announcement came exactly a month after we reported on a licensing brouhaha that had resulted in a standoff between Facebook and the Apache Foundation.
Continue reading “Facebook Relents on React.js License Issue via @InfoSecHotSpot”

Developer Spotlight: Matt Cain – Cosmic JS – Medium

  • Developer Spotlight: Matt CainIn our latest installment of the Cosmic JS Developer Spotlight Series, we sat down with Matt Cain, a web developer who took a physics undergrad and spring-boarded into the world of Java, Rails and ultimately, programming language agnostic APIs.
  • In addition to his day job of being a Creative Director and writing code, Matt is a Cosmic JS Contributor and responsible for several apps and blogs in our ecosystem.
  • More recently, I was pretty satisfied with the Premium User Blog app I built for Cosmic JS.Talk a little bit more about your process for building apps, who they’re for, and how Cosmic JS has helped.
  • Cosmic JS being essentially a simple to use, one-stop-shop for everything I need to deploy is a blessing.What are some technologies you are excited about that you are using today, or want to learn more about?I’m excited about using PWA’s and integrating bots in sites more.
  • I’m very much looking foward to where AR goes.To learn how you can contribute apps, blogs and extensions to the Cosmic JS Community, contact us at support@cosmicjs.com.

In our latest installment of the Cosmic JS Developer Spotlight Series, we sat down with Matt Cain, a web developer who took a physics undergrad and spring-boarded into the world of Java, Rails and…
Continue reading “Developer Spotlight: Matt Cain – Cosmic JS – Medium”

Organize a Large React Application and Make It Scale

Organize a Large React Application and Make It Scale

☞ 

#reactjs

  • In this article, I’ll talk you through the decisions I make when building React application: picking tools, structuring files, and breaking components up into smaller pieces.
  • Once you’ve done that you can always import files relative to the directory:

    Whilst this does tie your application code to Webpack, I think it’s a worthwhile trade-off because it makes your code much easier to follow and imports much easier to add, so this is a step I’ll take with all new projects.

  • For example, we have a folder called that contains all components relating to the shopping cart view, and a folder called that contains code for listing things users can buy on a page.
  • Following on from the previous rule, we stick to a convention of one React component file, and the component should always be the default export.
  • Normally our React files look like so:

    In the case that we have to wrap the component in order to connect it to a Redux data store, for example, the fully wrapped component becomes the default export:

    You’ll notice that we still export the original component; this is really useful for testing where you can work with the “plain” component and not have to set up Redux in your unit tests.

I’ll talk you through the decisions I make when building React applications :picking tools, structuring files,and breaking components up into smaller pieces
Continue reading “Organize a Large React Application and Make It Scale”

Iterators Using ES6 – Felipe Valdivia – Medium

  • However, as is often the case when a task occurs frequently, JavaScript now provides methods that simplify this task.These methods, called iterators, are called on arrays and complete such tasks as altering each element and selecting elements that fit certain criteria.So in this article you are going to learn how to use some of this iterator.
  • forEach()” will execute the same code on each element of an array.forEach() ExampleThis iterator will execute the same code on each element of an array, so in the example above we are going to go over each element in our array and print it on the console, the argument that you can see in parenthesis doesn’t matter in this case we are using “fruitItem” because is a good practice to have descriptives names.
  • map() iterator but in this case we are creating a new array with the result, so we need to create the variable and inside the block have the condition, that in this case we are going to create a new array with all the numbers divided by 100.
  • filter() exampleIn this example you can see how with filter we go over all the items but we just return the ones that are shorter than 6 characters creating a new array just with these data that is already filter for our condition.ConclusionYes I know this article is short but I present to you 3 different types of iterator using javascript with this you can start playing with them creating projects just to get familiar with them.I can give you some research task that you can do, look for this 3 other that they are pretty common and learn how to use them, I hope you can start a project with this information or solve different problems.so briefly we can say:.
  • filter() checks every element in an array to see if it meets certain criteria and returns a new array with the elements that return truthy for the criteria.You can visit the Mozilla Developer Network to learn more about iterator methods (and all other parts of JavaScript!)

Hello guys this is my second article here about front end and this time I am going to be talking about the different iterators that we have in EcmaScript6. The idea of this post is just show you some…
Continue reading “Iterators Using ES6 – Felipe Valdivia – Medium”

How to make Jenkins build NodeJS, Ruby, and Maven on Docker

How To Make Jenkins Build #NodeJS, #Ruby, And #Maven On #Docker  #reactjs #devops

  • Jenkins can speed up repetitive tasks that robots are much better performing and Docker simplifies spinning up VM’s for your application in a very simple and repeatable way.
  • What I’m going to cover here is how to setup your Jenkins server in a Docker container and how to fix some of the limits of the Jenkins official image.
  • While it is nice of Jenkins to offer an official docker image, you’ll quickly run into a few issues if you are doing anything even slightly other than compiling plain Java.
  • For instance, Maven, the popular dependency management tool for Java, is not included in the Docker container.
  • You’ve learned to create a Jenkins Docker-container that’s ready to run jobs for Java, Ruby and NodeJS projects.

Setup your Jenkins server in a Docker container and fix some of the limits of the official image I discovered so you can get up and building faster.
Continue reading “How to make Jenkins build NodeJS, Ruby, and Maven on Docker”