jsdoc/test/specs/documentation/anonymousclass.js
Jeff Williams aa0b6c1bfa switch to new-ish ECMAScript syntax
With help from Lebab, plus a lot of manual cleanup. (And more cleanup to come, I'm sure.)
2019-01-15 18:39:10 -08:00

24 lines
993 B
JavaScript

describe('anonymous class', () => {
const docSet = jasmine.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');
});
});