LED Me Know

LED Me Know is a little side project to enhance a front-ender's development environment, but really, it's just an excuse to play around with an arduino.

Wouldn't it be cool to have some LEDs connected to an arduino, connected to your development tooling, letting you know when you've broken a test as you code?

Well, that's the idea.

A group of LEDs accessible by gulp, in turn making the tooling workflow slightly more visual. If you've got gulp tasks to automate running your tests as you code, you could then hook into the reporting, and display whether the tests have passed or failed by flashing the LEDs with green or red respectively.

So yeah, it LEDs you know (pun obviously intended) when you've broken your code as you code.

The Setup

To get this working, you may not need the specific board and IO that I used as many other alternatives will work just as well, so there's no need to use the specific ones I'll be mentioning in this post.

The board is an Arduino Uno, connected with an Adafruit NeoPixel 12 RGB LED matrix and a couple of npm libraries I put together: led-me-know and karma-ledmeknow-reporter.

I won't go into too much detail about how I put the arduino and matrix together, as there are loads of resources out there doing this. You will also need a couple of connectors. Putting them together is pretty straight forward: match up the ground and power inputs together, and connect data in on the matrix to one of the data channels on the arduino. The default channel I used is 6.


Once that's all connected together, you need to install the firmware which allows the npm libraries to interact with the arduino and matrix. For more information on doing this, checkout the node-pixel installation guide.

Now you can control the LEDs from your tooling scripts. I've written a small library, led-me-know, which provides a small API for triggering the LED matrix with pass and failure patterns. You can check out the karma-ledmeknow-reporter to see an example of how it can be used.

The Result

I added a bit of a timeout for these gifs before the red or green flashes are triggered. The tests I was using were pretty short, leaving very little time for the loading animation.

This is what it looks like when your tests are passing


... and when they're failing



So far I've only written a custom reporter for Karma. If anyone wants to create a reporter for another testing library, send over a PR to the led-me-know lib, adding your reporter to the README with a link to it. I'd like to keep a list of all the led-me-know reporters.


Johnny Copperstone
Johnny Copperstone

Senior Developer at Marketing Cloud, Salesforce.