forked from jsdoc/jsdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support the
nocollapse
tag (Closure Compiler only) (jsdoc#605)
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* A namespace. | ||
* @const | ||
*/ | ||
var foo = {}; | ||
|
||
/** @nocollapse */ | ||
foo.bar = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}); | ||
}); | ||
}); |