mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
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.
38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
/* global jsdoc */
|
|
describe('underscore plugin', () => {
|
|
const env = require('jsdoc/env');
|
|
const path = require('jsdoc/path');
|
|
|
|
let docSet;
|
|
const parser = jsdoc.createParser();
|
|
const pluginPath = 'plugins/underscore';
|
|
const fixturePath = 'plugins/test/fixtures/underscore';
|
|
const pluginPathResolved = path.join(env.dirname, pluginPath);
|
|
|
|
require('jsdoc/plugins').installPlugins([pluginPathResolved], parser);
|
|
docSet = jsdoc.getDocSetFromFile(`${fixturePath}.js`, parser);
|
|
|
|
it('should not mark normal, public properties as private', () => {
|
|
// Base line tests
|
|
const normal = docSet.getByLongname('normal');
|
|
|
|
expect(normal[0].access).toBeUndefined();
|
|
|
|
const realPrivate = docSet.getByLongname('Klass#privateProp');
|
|
|
|
expect(realPrivate[0].access).toEqual('private');
|
|
});
|
|
|
|
it('should hide doclet for symbols beginning with an underscore under normal circumstances', () => {
|
|
const hidden = docSet.getByLongname('_hidden');
|
|
|
|
expect(hidden[0].access).toEqual('private');
|
|
});
|
|
|
|
it('picks up "this"', () => {
|
|
const privateUnderscore = docSet.getByLongname('Klass#_privateProp');
|
|
|
|
expect(privateUnderscore[0].access).toEqual('private');
|
|
});
|
|
});
|