jsdoc/test/specs/documentation/anonymousclass.js
Jeff Williams 617b3236bf Replace old, vendored Jasmine with current npm package.
JSDoc-specific test functions are now properties of a `jsdoc` global, not a `jasmine` global.

Also updates license files to reflect the fact that we no longer vendor anything.
2019-05-12 15:10:38 -07:00

24 lines
991 B
JavaScript

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');
});
});