jsdoc/test/specs/documentation/anonymousclass.js
Jeff Williams 5f578e803b migrate from old, vendored Jasmine to jasmine package (#1602)
Plus some miscellaneous cleanup.
2019-01-21 19:38:07 -08:00

25 lines
1010 B
JavaScript

/* global jsdoc */
describe('anonymous class', () => {
const docSet = jsdoc.getDocSetFromFile('test/fixtures/anonymousclass.js');
const klass = docSet.getByLongname('module:test').filter(({undocumented}) => !undocumented)[1];
const foo = docSet.getByLongname('module:test#foo')[0];
const klassTest = docSet.getByLongname('module:test#test')[0];
const klassStaticTest = docSet.getByLongname('module:test.staticTest')[0];
it('should merge the constructor docs with the class docs', () => {
expect(klass.description).toBe('Test constructor');
});
it('should use the correct longname for instance properties', () => {
expect(foo.description).toBe('Test member');
});
it('should use the correct longname for instance methods', () => {
expect(klassTest.description).toBe('Test method');
});
it('should use the correct longname for static methods', () => {
expect(klassStaticTest.description).toBe('Test static method');
});
});