jsdoc/plugins/test/specs/escapeHtml.js
Jeff Williams 617b3236bf Replace old, vendored Jasmine with current npm package.
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.
2019-05-12 15:10:38 -07:00

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 &lt;, &amp; and newlines');
});
});