Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit d7afe49

Browse files
committed
✅ Add spec for JSDoc optional parameter default values
1 parent a06143a commit d7afe49

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spec/javascript-spec.coffee

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,10 @@ describe "Javascript grammar", ->
15141514
expect(tokens[6]).toEqual value: '[variable]', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc']
15151515
expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
15161516

1517-
1517+
{tokens} = grammar.tokenizeLine('/** @param {object} [variable=default value] this is the description */')
1518+
expect(tokens[4]).toEqual value: '{object}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc']
1519+
expect(tokens[6]).toEqual value: '[variable=default value]', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc']
1520+
expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
15181521

15191522
it "tokenizes // comments", ->
15201523
{tokens} = grammar.tokenizeLine('// comment')

0 commit comments

Comments
 (0)