getset.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. 'use strict';
  2. describe('When a getter or setter is part of a class', function() {
  3. var docSet = jasmine.getDocSetFromFile('test/fixtures/getset.js');
  4. describe('in an object literal', function() {
  5. var name = docSet.getByLongname('Person#name');
  6. var age = docSet.getByLongname('Person#age');
  7. it('should have a doclet with the correct longname', function() {
  8. expect(name.length).toBe(2);
  9. expect(age.length).toBe(1);
  10. });
  11. it('should have a doclet with the correct name', function() {
  12. expect(name[0].name).toBe('name');
  13. expect(name[1].name).toBe('name');
  14. expect(age[0].name).toBe('age');
  15. });
  16. it('should have a doclet with the correct kind', function() {
  17. expect(name[0].kind).toBe('member');
  18. expect(name[1].kind).toBe('member');
  19. expect(age[0].kind).toBe('member');
  20. });
  21. it('should have a doclet with the correct memberof', function() {
  22. expect(name[0].memberof).toBe('Person');
  23. expect(name[1].memberof).toBe('Person');
  24. expect(age[0].memberof).toBe('Person');
  25. });
  26. });
  27. describe('in an ES 2015 class', function() {
  28. var docSet2 = jasmine.getDocSetFromFile('test/fixtures/getset2.js');
  29. var location = docSet2.getByLongname('Employee#location');
  30. it('should have a doclet with the correct longname', function() {
  31. expect(location.length).toBe(2);
  32. });
  33. it('should have a doclet with the correct name', function() {
  34. expect(location[0].name).toBe('location');
  35. expect(location[1].name).toBe('location');
  36. });
  37. it('should have a doclet with the correct kind', function() {
  38. expect(location[0].kind).toBe('member');
  39. expect(location[1].kind).toBe('member');
  40. });
  41. it('should have a doclet with the correct memberof', function() {
  42. expect(location[0].memberof).toBe('Employee');
  43. expect(location[1].memberof).toBe('Employee');
  44. });
  45. });
  46. });