UNPKG

@tlrg/middleware-js

Version:
20 lines (16 loc) 600 B
require('chai').should(); var pickFirst = require('../../lib/common/pickFirst'); describe('pickFirst Middleware', function () { describe('when passed a string', function () { it('should return the string', function () { var testString = 'cheeky'; pickFirst(testString).should.eql('cheeky'); }); }); describe('when passed an array', function () { it('should return the first item in the array', function () { var testArray = ['cheeky' , 'chaps']; pickFirst(testArray).should.eql('cheeky'); }); }); });