diff --git a/test/javascript/util/core.js b/test/javascript/util/core.js index cd78116a87..d69d7d5785 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() { });