mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
JSDoc-specific test functions are now properties of a `jsdoc` global, not a `jasmine` global. Also updates license files to reflect the fact that we no longer vendor anything.
21 lines
785 B
JavaScript
21 lines
785 B
JavaScript
/* global jsdoc */
|
|
describe('escapeHtml plugin', () => {
|
|
const env = require('jsdoc/env');
|
|
const path = require('jsdoc/path');
|
|
|
|
let docSet;
|
|
const parser = jsdoc.createParser();
|
|
const pluginPath = 'plugins/escapeHtml';
|
|
const pluginPathResolved = path.join(env.dirname, pluginPath);
|
|
|
|
require('jsdoc/plugins').installPlugins([pluginPathResolved], parser);
|
|
docSet = jsdoc.getDocSetFromFile(`${pluginPath}.js`, parser);
|
|
|
|
it("should escape '&', '<' and newlines in doclet descriptions", () => {
|
|
const doclet = docSet.getByLongname('module:plugins/escapeHtml.handlers.newDoclet');
|
|
|
|
expect(doclet[0].description).toBe('Translate HTML tags in descriptions into safe ' +
|
|
'entities. Replaces <, & and newlines');
|
|
});
|
|
});
|