jsdoc/plugins/test/specs/escapeHtml.js
Jeff Williams ae94af0cd8 turn env global into a module, and use the module instead of the global (#812)
The `env` global remains available, since templates and plugins may rely upon it, but it's deprecated as of JSDoc 3.4.0.
2015-02-17 19:07:10 -08:00

21 lines
825 B
JavaScript

'use strict';
describe('escapeHtml plugin', function() {
var env = require('jsdoc/env');
var path = require('jsdoc/path');
var docSet;
var parser = jasmine.createParser();
var pluginPath = 'plugins/escapeHtml';
var pluginPathResolved = path.join(env.dirname, pluginPath);
var plugin = require(pluginPathResolved);
require('jsdoc/plugins').installPlugins([pluginPathResolved], parser);
docSet = jasmine.getDocSetFromFile(pluginPath + '.js', parser);
it("should escape '&', '<' and newlines in doclet descriptions", function() {
var doclet = docSet.getByLongname('module:plugins/escapeHtml.handlers.newDoclet');
expect(doclet[0].description).toEqual('Translate HTML tags in descriptions into safe entities.<br> Replaces &lt;, &amp; and newlines');
});
});