escapeHtml.js 769 B

1234567891011121314151617181920
  1. 'use strict';
  2. describe('escapeHtml plugin', function() {
  3. var env = require('jsdoc/env');
  4. var path = require('jsdoc/path');
  5. var docSet;
  6. var parser = jasmine.createParser();
  7. var pluginPath = 'plugins/escapeHtml';
  8. var pluginPathResolved = path.join(env.dirname, pluginPath);
  9. require('jsdoc/plugins').installPlugins([pluginPathResolved], parser);
  10. docSet = jasmine.getDocSetFromFile(pluginPath + '.js', parser);
  11. it("should escape '&', '<' and newlines in doclet descriptions", function() {
  12. var doclet = docSet.getByLongname('module:plugins/escapeHtml.handlers.newDoclet');
  13. expect(doclet[0].description).toEqual('Translate HTML tags in descriptions into safe entities. Replaces &lt;, &amp; and newlines');
  14. });
  15. });