Crafting Dropdown with React and Jest

On my last post, I’ve talked about configuring ESlint with Airbnb convention on RubyMine editor. Now, I’m ready to write JavaScript code!

My team use React for creating frontend component, so this time I’ll explain about creating dropdown using React by creating the test first using Jest.

Continue reading “Crafting Dropdown with React and Jest”

Advertisements

Test for Control

I just got this thought when trying to write test for a controller yesterday: how exactly did you test a controller?

A controller is a route between model and view. It controls the system behavior given user action. But the validity of the data presented was already tested in the model, and whether the data shows right should be tested in the front end. Continue reading “Test for Control”

Airbnb JavaScript Convention

Like what I mentioned in the previous post, my team will use Airbnb convention for writing JavaScript code. I looked on their Github, they provide so many guides to write JavaScript especially in ES6 syntax. Yep, my team will follow the guides there. But of course, we can’t remember all the rules at once, so we use the linter config provided by Airbnb. There will be a warning (or an error) message on every lines of our code that break the rules.

Continue reading “Airbnb JavaScript Convention”