diff --git a/test/fixtures/doclet.js b/test/fixtures/doclet.js new file mode 100644 index 00000000..abba2473 --- /dev/null +++ b/test/fixtures/doclet.js @@ -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) { + +} diff --git a/test/specs/jsdoc/doclet.js b/test/specs/jsdoc/doclet.js index 1bb1500f..ad9345dd 100644 --- a/test/specs/jsdoc/doclet.js +++ b/test/specs/jsdoc/doclet.js @@ -1,3 +1,22 @@ +/*global describe: true, env: true, expect: true, it: true, jasmine: true, xit: true */ describe("jsdoc/doclet", function() { - //TODO -}); \ No newline at end of file + // 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); + }); +});