Spying on ES6 modules

Spying on ES6 modules

Please familiarise yourself with why we have ES6 Modules and its terminology as it going to help you to understand some of the issues we will be discussing here. The article, An Introduction To JavaScript ES6 Modules is a good place to start.

We can write perfectly functioning code, that is simple, readable and optimised. But when it comes to testing, it adds another dimension to your code and changes the way you would approach coding. Those who have developed in C#, you know why we need Interfaces and implementing it will change the way you approach writing your code.

The following issues are known pain points when it comes to testing ES6 modules:

  • Named Exports
  • Multiple Exports

We will use a Warehouse example, which uses Mocha, Sinon and Chai, to explore how we can rewrite the code to get them to pass the above mentioned pain points, and still have them function properly. Although the title mentions spying, the idea is that if you can Spy then you should be able to Stub and Mock.

Continue reading “Spying on ES6 modules”

Introduction to testing in JavaScript

Introduction to testing in JavaScript

The ever growing JavaScript ecosystem is built by the developer community to solve their problems their way, which is ever so slightly different to the solutions that already exist. So when it comes to testing, the arena is quite deconstructed, just like the hipster cafes in Melbourne serving up ‘deconstructed’ coffee.

The main focus of this article is to give you an idea about how testing sits together in JavaScript and help you understand why and how it is deconstructed so that you can make better choices when it comes to choosing a library for the job at hand. After all we don’t want you to become a Candy Land developer, just because there are too many choices.

Continue reading “Introduction to testing in JavaScript”

Basic Cost Calculation in Online Advertising

When you advertise online, as an advertiser, you are paying to acquire more business or to increase your brand & product exposure or both. The cost of online advertisement is based on what do you expect to get out of it. There are several basic metrics of an advertisement to help you out with it.

Continue reading “Basic Cost Calculation in Online Advertising”

Managing Tech Debts

Managing Tech Debts

As developers, it is a difficult task to explain to our product owner the business value of a piece of technical work that needs doing. It is also difficult to provide risk analysis for these tasks. In turn, as a product owner, it is hard for them to prioritise such technical work with out coming across technical reasoning and jargon.

At Barnardos, together with Readify consultant Abdelmawla Mohamed, we are exploring how we can define these technical work in such way that it is easy for the developers to describe the work involved and the risks associated with it without using technical jargon, while still providing a common language and consistent representation of impact and risks to help the product owner with prioritising.

Continue reading “Managing Tech Debts”