tests for doclets with Markdown asterisks

This commit is contained in:
Jeff Williams 2012-09-09 07:18:13 -07:00
parent 7c0d72415d
commit e59dc9023a
2 changed files with 44 additions and 2 deletions

23
test/fixtures/doclet.js vendored Normal file
View File

@ -0,0 +1,23 @@
/**
Markdown asterisks in a doclet that does not use leading asterisks.
**Strong** is strong.
* List item 1.
* List item 2.
@param {string} thingy - The thingy.
*/
function test1(thingy) {
}
/**
* Markdown asterisks in a doclet that uses leading asterisks.
* **Strong** is strong.
*
* * List item 1.
* * List item 2.
* @param {string} thingy - The thingy.
*/
function test2(thingy) {
}

View File

@ -1,3 +1,22 @@
/*global describe: true, env: true, expect: true, it: true, jasmine: true, xit: true */
describe("jsdoc/doclet", function() { describe("jsdoc/doclet", function() {
//TODO // TODO: more tests
var docSet = jasmine.getDocSetFromFile('test/fixtures/doclet.js'),
test1 = docSet.getByLongname('test1')[0],
test2 = docSet.getByLongname('test2')[0];
var expectStrong = "**Strong** is strong";
var expectList = "* List item 1";
// TODO: reenable the test and make it pass, or remove the test
xit('does not mangle Markdown in a description that does not use leading asterisks', function() {
expect(test1.description.indexOf(expectStrong)).toBeGreaterThan(-1);
expect(test1.description.indexOf(expectList)).toBeGreaterThan(-1);
});
it('does not mangle Markdown in a description that uses leading asterisks', function() {
expect(test2.description.indexOf(expectStrong)).toBeGreaterThan(-1);
expect(test2.description.indexOf(expectList)).toBeGreaterThan(-1);
});
}); });