A few days ago I was working on a task in which I’ve to write an endpoint to download a file from the server.

As usual, for every code we write in the team(at least for the backend side), we write the correct test cases. Until now, I had written test cases that checked the returned http code, the correct Content-Type, Content-Disposition and Content-Length headers and that’s all. This time, I want to check that I’m downloading the correct file (check the content I’m receiving).

First, I was thinking that it would be just check the “body” in the response…

Si una palabra se ha extendido en los últimos meses por todo el mundo, además de la tristemente conocida “COVID-19", es “teletrabajo” y esta, poco a poco se ha ido adueñando de portadas de periódicos y noticiarios, entradas en blogs, etc… .

Lo que debemos destacar es que para nada es algo nuevo, sólo en Estados Unidos desde 2005 hasta 2019 hubo un aumento de un 159% en esta tendencia (artículo en inglés). …

After working with Node.js for more than 5 years, I can say that its package module system is one of the keys to its large adoption in many companies. In my case, I used to take advantage of this feature.

In my team, we follow some rules to organize our code:

  1. Code in one project is split in several files to separate business or utility concerns.
  2. When a code is required for several projects, we create a module with a concrete mission and a defined interface. Then, we require the module in every project that needs the functionality.
  3. When a…

A few months ago the linux foundation published the expected Node.js certifications: OpenJS Node.js Application Developer and OpenJS Node.js Services Developer . Here you will find all the needed information about the certification requirements, topics, process and prices (you can get a 30% discount which is valid until May 31 2020). By now, when you get the voucher for the exam, you will get a free 2nd attempt.

The Candidate Handbook and the Tips Document are two important documents I recommend you to read carefully.

By the time I first started to look for information about the exam I didn’t…

Hace ya unos meses, la Linux Foundation, presentó las esperadas certificaciones para Node.js: OpenJS Node.js Application Developer and OpenJS Node.js Services Developer. En estos enlaces podrás encontrar toda la información necesaria sobre los requisitos, temario, proceso para el examen y precios (hasta el 31 de Mayo de 2020, está disponible un descuento del 30%). Al menos por ahora, cuando obtienes el voucher para tu examen, obtienes también un segunda oportunidad en caso de no pasar el examen a la primera.

Dentro de la información disponible en el sitio oficial, el Candidate Handbook y el Tips Document son dos documentos importantes…

Almost every time I interview someone to work with Javascript, I use to make a question: “if I told you, hey, XXXX what is what you think I have to learn to start with Javascript and know it well (assume I already know how to program in any other language)?”

I have hear many different answers, thinks like: ES6, Promises, React,…

In the interviews I like to turn them in more a conversation than a questioning and like for other questions, I use to give mine about this one, here are the thinks I use to say:

  1. Types

Javascript is…

Every time I talk with people about TDD, the main topic is the difficulty of doing it well. I use to say that it’s no so easy as some people say it is, but also, is not so hard either.

From my point of view, you need to have 3 things:

1- To have a clear and well defined functionality: someone have to define the behaviour you have to code. It includes defining how it should behave when it works fine and also when it fails in any way it can.

2- To have a good level of envolved technology

In a previous post we saw the importance of the.lean() in your queries when you are using mongoose and you need to find out a big amount of data(and you don’t need any mongoose hook) to save time in your process.

Today we are going to see how to save time when you need to write that information into another mongodb collection.

Let’s see the code:

In this code we are making a find query, using lean() and a cursor to go through all the elements in our query.

We are “saving” the element in an array until we…

Recently I needed to perform some actions for big amounts of data stored in a mongodb collection. For the related project we are using nodes.js + mongodb(managed with mongoose). My first thought when starting this task to move data from one collection to another was to reuse the current mongoose schema we have been using to handle the data in our application.

For testing purposes I wanted to know how much time it would take to read the required data and iterate over it. …

Ángel Cereijo

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store