Commit afe7c35 1 parent d06ba27 commit afe7c35 Copy full SHA for afe7c35
File tree 3 files changed +51
-0
lines changed
3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -866,6 +866,10 @@ exports.closureTags = {
866
866
export : {
867
867
onTagged : ignore
868
868
} ,
869
+ // Closure Compiler only
870
+ externs : {
871
+ onTagged : ignore
872
+ } ,
869
873
extends : cloneTagDef ( baseTags . augments ) ,
870
874
final : cloneTagDef ( baseTags . readonly ) ,
871
875
implements : cloneTagDef ( baseTags . implements ) ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * This is an externs file.
3
+ *
4
+ * @externs
5
+ */
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ describe ( '@externs tag' , function ( ) {
4
+ var env = require ( 'jsdoc/env' ) ;
5
+ var logger = require ( 'jsdoc/util/logger' ) ;
6
+
7
+ var allowUnknownTags = Boolean ( env . conf . tags . allowUnknownTags ) ;
8
+
9
+ beforeEach ( function ( ) {
10
+ env . conf . tags . allowUnknownTags = false ;
11
+ spyOn ( logger , 'error' ) ;
12
+ } ) ;
13
+
14
+ afterEach ( function ( ) {
15
+ jasmine . restoreTagDictionary ( ) ;
16
+ env . conf . tags . allowUnknownTags = allowUnknownTags ;
17
+ } ) ;
18
+
19
+ describe ( 'JSDoc tags' , function ( ) {
20
+ beforeEach ( function ( ) {
21
+ jasmine . replaceTagDictionary ( 'jsdoc' ) ;
22
+ } ) ;
23
+
24
+ it ( 'should not recognize the @externs tag' , function ( ) {
25
+ jasmine . getDocSetFromFile ( 'test/fixtures/externstag.js' ) ;
26
+
27
+ expect ( logger . error ) . toHaveBeenCalled ( ) ;
28
+ } ) ;
29
+ } ) ;
30
+
31
+ describe ( 'Closure Compiler tags' , function ( ) {
32
+ beforeEach ( function ( ) {
33
+ jasmine . replaceTagDictionary ( 'closure' ) ;
34
+ } ) ;
35
+
36
+ it ( 'should recognize the @externs tag' , function ( ) {
37
+ jasmine . getDocSetFromFile ( 'test/fixtures/externstag.js' ) ;
38
+
39
+ expect ( logger . error ) . not . toHaveBeenCalled ( ) ;
40
+ } ) ;
41
+ } ) ;
42
+ } ) ;
You can’t perform that action at this time.
0 commit comments