Skip to content

Commit

Permalink
Use pull request foundation#10941 from dragthor/getfnname-tests for v…
Browse files Browse the repository at this point in the history
…6.5.0

5137351 getFnName unit tests

Signed-off-by: Nicolas Coden <nicolas@ncoden.fr>
  • Loading branch information
dragthor authored and ncoden committed Jun 16, 2018
1 parent cb51f4a commit 3fe615e
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion test/javascript/util/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
});

Expand Down

0 comments on commit 3fe615e

Please sign in to comment.