Adding mocha unit tests

Update: This post is now available at a new location:
https://blog.ngeor.com/2017/12/29/adding-mocha-unit-tests.html

In this post, I’ll add unit tests to the example application that I’ve been fiddling around with in the recent posts.

Continue reading Adding mocha unit tests

Advertisements

Functional Testing – Hiding Async

Update: This post is now available at a new location:
https://blog.ngeor.com/2016/08/06/functional-testing-hiding-async.html

In the previous post, we explored the Page Object pattern and rewrote our tests to use this technique. Sometimes, it can be that the tests appear to be a bit verbose due to the usage of promises. Additionally, promises and asynchronous programming in general can be somewhat confusing to developers. Let’s see some ways of making the tests shorter and easier to read.

Continue reading Functional Testing – Hiding Async

Using sinon spies

Update: This post is now available at a new location:
https://blog.ngeor.com/2016/05/21/using-sinon-spies.html

In the previous post, we implemented a new feature for our calculator: it makes a bell sound when you divide by zero. The bell is a simple function that the calculator calls and it is provided as a constructor dependency. We wrote a unit test for this as well, but the code for that is a bit verbose. Let’s see how we can use a mocking library like sinon to reduce and standardize the testing code. Continue reading Using sinon spies

A closer look to a basic unit test

Update: This post is now available at a new location:
https://blog.ngeor.com/2016/04/23/a-closer-look-to-a-basic-unit-test.html

In the previous post we started writing a basic Calculator class and added the first unit test. Let’s have a closer look at that unit test and extend our calculator with more features.

Continue reading A closer look to a basic unit test

Chai as promised with Chai string

Update: This post is now available at a new location:
https://blog.ngeor.com/2016/02/22/chai-as-promised-with-chai-string.html

Here’s a small tip that puzzled us at work the other day for a while. How do you use chai-as-promised together with chai-string? Continue reading Chai as promised with Chai string

Adventures with automated browser tests in JavaScript

Update: This post is now available at a new location:
https://blog.ngeor.com/2016/02/04/adventures-with-automated-browser-tests-in-javascript.html

This is a long post, be advised! It goes through the adventures we have had at work with automated browser tests in JavaScript. It has been a journey full of challenges and knowledge build up, a journey that still goes on! Continue reading Adventures with automated browser tests in JavaScript