var productBasket = function (products) { return { total: function () { return 0; } } }; describe('Product basket', function () { describe('#total()', function () { it('returns 0 when basket is empty', function () { expect(productBasket([]).total()).toEqual(0); }); }) });