1 | 'use strict';
|
2 |
|
3 | describe('underscore plugin', function () {
|
4 | var env = require('jsdoc/env');
|
5 | var path = require('jsdoc/path');
|
6 |
|
7 | var docSet;
|
8 | var parser = jasmine.createParser();
|
9 | var pluginPath = 'plugins/underscore';
|
10 | var fixturePath = 'plugins/test/fixtures/underscore';
|
11 | var pluginPathResolved = path.join(env.dirname, pluginPath);
|
12 | var plugin = require(pluginPathResolved);
|
13 |
|
14 | require('jsdoc/plugins').installPlugins([pluginPathResolved], parser);
|
15 | docSet = jasmine.getDocSetFromFile(fixturePath + '.js', parser);
|
16 |
|
17 | it('should not mark normal, public properties as private', function() {
|
18 |
|
19 | var normal = docSet.getByLongname('normal');
|
20 | expect(normal[0].access).toBeUndefined();
|
21 |
|
22 | var realPrivate = docSet.getByLongname('Klass#privateProp');
|
23 | expect(realPrivate[0].access).toEqual('private');
|
24 | });
|
25 |
|
26 | it('should hide doclet for symbols beginning with an underscore under normal circumstances', function () {
|
27 | var hidden = docSet.getByLongname('_hidden');
|
28 | expect(hidden[0].access).toEqual('private');
|
29 | });
|
30 |
|
31 | it('picks up "this"', function() {
|
32 | var privateUnderscore = docSet.getByLongname('Klass#_privateProp');
|
33 | expect(privateUnderscore[0].access).toEqual('private');
|
34 | });
|
35 | });
|