Skip to content

test(description-tag): Confirm behavior of description tag with tests #720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion test/fixture/meta.input.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* This function returns the number one.
* This description is ignored because the method has a tagged description.
* @returns {number} numberone
* @description This function returns the number one.
* @see {@link http://github.com/|github}
* @see TestCase
* @see [markdown link](http://foo.com/)
Expand Down
25 changes: 15 additions & 10 deletions test/fixture/meta.output.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,40 +62,45 @@
"name": "number"
}
},
{
"title": "description",
"description": "This function returns the number one.",
"lineNumber": 3
},
{
"title": "see",
"description": "{@link http://github.com/|github}",
"lineNumber": 3
"lineNumber": 4
},
{
"title": "see",
"description": "TestCase",
"lineNumber": 4
"lineNumber": 5
},
{
"title": "see",
"description": "[markdown link](http://foo.com/)",
"lineNumber": 5
"lineNumber": 6
},
{
"title": "version",
"description": "1.0.0",
"lineNumber": 6
"lineNumber": 7
},
{
"title": "since",
"description": "2.0.0",
"lineNumber": 7
"lineNumber": 8
},
{
"title": "copyright",
"description": "Tom MacWright",
"lineNumber": 8
"lineNumber": 9
},
{
"title": "license",
"description": "BSD",
"lineNumber": 9
"lineNumber": 10
}
],
"loc": {
Expand All @@ -104,18 +109,18 @@
"column": 0
},
"end": {
"line": 11,
"line": 12,
"column": 3
}
},
"context": {
"loc": {
"start": {
"line": 12,
"line": 13,
"column": 0
},
"end": {
"line": 15,
"line": 16,
"column": 2
}
}
Expand Down
15 changes: 15 additions & 0 deletions test/lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,21 @@ test('parse - @augments', function(t) {
t.end();
});

test('parse - @description', function(t) {
t.deepEqual(
evaluate(function() {
/**
* This is a free-form description
* @description This tagged description wins, and [is markdown](http://markdown.com).
*/
})[0].description,
remark().parse('This tagged description wins, and [is markdown](http://markdown.com).'),
'description'
);

t.end();
});

/*
* Dossier-style augments tag
* https://github.com/google/closure-library/issues/746
Expand Down