@tlrg/middleware-js
Version:
Node module for sharing common middlewares.
20 lines (16 loc) • 600 B
JavaScript
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');
});
});
});