jsdoc/plugins/test/specs/escapeHtml.js
Jeff Williams 751bea1b0a fixes for Node.js compatibility (see details)
- new Rhino .jar to help find module paths
(https://github.com/hegemonic/rhino/commit/31b70105)
- make __dirname and process.cwd() provide the current module path; use
only env.dirname for JSDoc's home dir; fix callers
- get rid of jsdoc/util/include (and update test framework accordingly)
- avoid running Rhino/Node.js tests on the wrong runtime
- remove support for global 'publish' function, which relied upon
jsdoc/util/include
- update jsdoc/util/dumper for consistency with Node.js'
JSON.stringify()
- fix jsdoc/util/runtime to detect Node.js correctly
- add Node.js versions of jsdoc/fs and jsdoc/path
- other minor cleanup
2013-10-25 23:30:56 -07:00

20 lines
871 B
JavaScript

/*global describe: true, env: true, expect: true, it: true, jasmine: true */
describe("escapeHtml plugin", function() {
var parser = new (require('jsdoc/src/parser')).Parser();
var path = require('jsdoc/path');
var docSet;
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");
});
});