From 51373515cc68df6a33234afc1acb0e745a6dbcbc Mon Sep 17 00:00:00 2001 From: Kristofer Krause Date: Wed, 14 Feb 2018 17:00:05 -0500 Subject: [PATCH] getFnName unit tests --- test/javascript/util/core.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/test/javascript/util/core.js b/test/javascript/util/core.js index cd78116a8..d69d7d578 100644 --- a/test/javascript/util/core.js +++ b/test/javascript/util/core.js @@ -84,8 +84,31 @@ describe('Foundation core', function() { }); describe('getFnName()', function() { - }); + it('should handle a function declaration', function() { + function A() {}; + var name = Foundation.getFnName(A); + + name.should.be.a('string'); + name.should.be.equal('A'); + }); + + it('should handle a function expression', function() { + var B = function(){}; + var name = Foundation.getFnName(B); + name.should.be.a('string'); + name.should.be.equal(''); + }); + + it('should handle a named function expression', function() { + var D = function foo(){}; + var name = Foundation.getFnName(D); + + name.should.be.a('string'); + name.should.be.equal('foo'); + }); + }); + describe('transitionEnd()', function() { }); -- 2.47.2