Plurrrr

Thu 19 Nov 2020

How to unit-test a private (non-exported) function in JavaScript

When writing unit-tests for JavaScript modules, we often encounter a dilemma wherein the module has some private functions that have not been exported. Testing a function that has been exported is easy since it can be imported in the unit testing framework, and the functionality can be tested. But how to unit-test a private (non-exported) function?

Source: How to unit-test a private (non-exported) function in JavaScript, an article by Saransh Kataria.

Adam's Acanthoscurria geniculata

In the early evening I managed to remove the lid of the enclosure of Adam's Acanthoscurria geniculata without disturbing the spider. The juvenile female tarantula was resting on top of its burrow, so I took several photos. She's very skittish and most of the time when I remove the lid she hides from view immediately.

Acanthoscurria geniculata resting on top of her burrow
Acanthoscurria geniculata resting on top of her burrow.