underscore.js 1.3 KB

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