mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
support the nocollapse tag (Closure Compiler only) (#605)
This commit is contained in:
parent
157255f7f7
commit
21583fe8a1
@ -898,6 +898,10 @@ exports.closureTags = {
|
||||
onTagged: ignore
|
||||
},
|
||||
// Closure Compiler only
|
||||
nocollapse: {
|
||||
onTagged: ignore
|
||||
},
|
||||
// Closure Compiler only
|
||||
override: {
|
||||
mustNotHaveValue: true,
|
||||
onTagged: function(doclet) {
|
||||
|
||||
8
test/fixtures/nocollapsetag.js
vendored
Normal file
8
test/fixtures/nocollapsetag.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* A namespace.
|
||||
* @const
|
||||
*/
|
||||
var foo = {};
|
||||
|
||||
/** @nocollapse */
|
||||
foo.bar = true;
|
||||
42
test/specs/tags/nocollapsetag.js
Normal file
42
test/specs/tags/nocollapsetag.js
Normal file
@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
describe('@nocollapse tag', function() {
|
||||
var env = require('jsdoc/env');
|
||||
var logger = require('jsdoc/util/logger');
|
||||
|
||||
var allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
|
||||
|
||||
beforeEach(function() {
|
||||
env.conf.tags.allowUnknownTags = false;
|
||||
spyOn(logger, 'error');
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
jasmine.restoreTagDictionary();
|
||||
env.conf.tags.allowUnknownTags = allowUnknownTags;
|
||||
});
|
||||
|
||||
describe('JSDoc tags', function() {
|
||||
beforeEach(function() {
|
||||
jasmine.replaceTagDictionary('jsdoc');
|
||||
});
|
||||
|
||||
it('should not recognize the @nocollapse tag', function() {
|
||||
jasmine.getDocSetFromFile('test/fixtures/nocollapsetag.js');
|
||||
|
||||
expect(logger.error).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Closure Compiler tags', function() {
|
||||
beforeEach(function() {
|
||||
jasmine.replaceTagDictionary('closure');
|
||||
});
|
||||
|
||||
it('should recognize the @nocollapse tag', function() {
|
||||
jasmine.getDocSetFromFile('test/fixtures/nocollapsetag.js');
|
||||
|
||||
expect(logger.error).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user