diff --git a/lib/helpers.js b/lib/helpers.js index 7bc2400..e8332ea 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -23,8 +23,8 @@ var noForLoops = function(func) { var noNewArrays = function(func) { var stringified = func.toString(); - it('should not create new arrays', function() { - expect(stringified.includes(('[]' || '[ ]'))).to.equal(false); + it('should not create new array literals', function() { + expect(stringified).not.to.match(/\[\s+\]/); }); } diff --git a/spec.js b/spec.js index c24a5e4..62dc685 100644 --- a/spec.js +++ b/spec.js @@ -346,6 +346,13 @@ var data = upperCaseFruits(testFruits); expect(data).to.not.eql(testFruits); }); + it('should return an array of strings', function () { + var data = upperCaseFruits(testFruits); + expect(Array.isArray(data), 'returned value should be an array').to.be.true; + _.each(data, function (fruit) { + expect(fruit).to.be.a('string'); + }); + }); it('should return an array with all strings converted to uppercase', function () { var data = upperCaseFruits(testFruits); var allUpperCase = true;