Use a mock in a unit test!

Signed-off-by: OwenPatey <owen_patey@hotmail.com>
Unit test using sinon.js stubs and matchers

Signed-off-by: OwenPatey <owen_patey@hotmail.com>