JSFiddle - React, Tailwind, and code Playground
JavaScript
describe('Product', function () {
var product;
beforeEach(function () {
product = new Product({name: 'foo'});
});
describe('.getName()', function () {
it('returns name formatted using format function', function () {
var formatFunctionStub = function (productName) { return productName + '-bar'; }
expect(product.getName(formatFunctionStub)).toEqual('foo-bar');
});
});
});