From: Kristofer Krause Date: Sat, 16 Jun 2018 07:15:55 +0000 (+0200) Subject: Use pull request #10941 from dragthor/getfnname-tests for v6.5.0 X-Git-Tag: v6.5.0-rc.1^2~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fe615ee20a5a7fc737be3e24d4ee1df1938e54b;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Use pull request #10941 from dragthor/getfnname-tests for v6.5.0 51373515c getFnName unit tests Signed-off-by: Nicolas Coden --- 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() { });