An experience-based story of how to test MobX State Tree

The Mulberry Tree in Autumn, Vincent Van Gogh, 1889

MobX State Tree is a state management solution for the front end world. If you want to learn more about it, have a look at this talk.

At DAZN we have been using MobX State Tree for more than a year now and this article is about what we learnt during the journey of writing all sort of tests. We’re going to analyse testing in a classic approach: starting from unit tests, then moving to integration tests and concluding with end to end tests.

Picking the right tool for the job is very important, but in this article I’d like…

Setting up a React & MobX project is not different from cooking a Strudel.

Basic ingredients for creating a Strudel

I’m more confident with savoury recipes, Lasagna and Tomato-based pastas are in my confort zone. But this time I had some spare apples and I decided to prepare a Strudel.

If you don’t know what a Strudel is:

AWS Lambda functions are the future, so we need a futuristic test runner.

In this post I'll show you how I used the “Futuristic JavaScript test runner” AVA to test AWS Lambda functions.

I started with a very basic Lambda function and the relative tests, and then I iterated over it, adding every time a new feature.

You can find everything described in this article in this repository.


The Beginning

How it works and how to fix the 502 Bad Gateway issue

AWS Lambda is a compute service that lets you run code without provisioning or managing servers

It was love at first sight. AWS Lambda serverless functions are easy to setup, they scale automatically and you only pay per use. Our future is going to be full of them!

Creating a Lambda is very straightforward, the setup process takes a few minutes even if you've never done it before. If you need a step by step guide, I'd suggest this one.

Ready, Steady, Go! This is a dramatically simple Lambda function inside the inline editor of the Lambda Management Console

La guida definitiva per invitarlo a cena

Conosciamo solamente il 5% di quello che chiamiamo “Universo”, eppure la domanda alla quale non sappiamo rispondere fino in fondo é:

Cosa mangia Giorgio?

Quante volte, tu che stai leggendo, ti sei trovato davanti allo stesso dubbio? Quante volte hai sentito il suo, seppur cordiale, “No grazie” ?

Non sei solo. Sono qui per aiutarti.

Le due tautologie

Una tautologia in logica, è un’affermazione vera per definizione.

  1. Non mangia niente di rosso ad eccezione di: ciliege, supplì, cocomero e pesche.
  2. Non mangia nessun tipo di verdura. (Ammesse le zucchine se disperse e poco riconoscibili all’interno di una pasta)

Il cibo

Max Gallo

Principal Engineer @ DAZN. Addicted to Technology, Design, Music, Motorbikes, Photography and Travels. I use spaces, not tabs.

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