funcExpression.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. describe('function expressions', function() {
  3. function checkLongnames(docSet, namespace) {
  4. var memberName = (namespace || '') + 'Foo#member1';
  5. var variableName = (namespace || '') + 'Foo~var1';
  6. var fooMember = docSet.getByLongname(memberName)[0];
  7. var fooVariable = docSet.getByLongname(variableName)[0];
  8. it('should assign the correct longname to members of a function expression', function() {
  9. expect(fooMember.longname).toBe(memberName);
  10. });
  11. it('should assign the correct longname to variables in a function expression', function() {
  12. expect(fooVariable.longname).toBe(variableName);
  13. });
  14. }
  15. describe('standard', function() {
  16. checkLongnames( jasmine.getDocSetFromFile('test/fixtures/funcExpression.js') );
  17. });
  18. describe('global', function() {
  19. checkLongnames( jasmine.getDocSetFromFile('test/fixtures/funcExpression2.js') );
  20. });
  21. describe('as object literal property', function() {
  22. checkLongnames( jasmine.getDocSetFromFile('test/fixtures/funcExpression3.js'), 'ns.' );
  23. });
  24. });