From 7fb738ab919a78cf8ec7e95e929f3dedca6e25c3 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 2 Jan 2016 14:00:00 -0600 Subject: [PATCH] Add `_.cond` test for function checks. --- test/test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test.js b/test/test.js index 3a9c09cd4..18812b952 100644 --- a/test/test.js +++ b/test/test.js @@ -2776,6 +2776,22 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.cond'); + + (function() { + QUnit.test('should throw a TypeError if `pairs` is not composed of functions', function(assert) { + assert.expect(2); + + var predicate = lodashStable.constant(true); + + lodashStable.each([true, false], function(value) { + assert.raises(function() { _.cond([[predicate, value]]); }, TypeError); + }); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.conforms'); (function() {