jsdoc/plugins/test/specs/railsTemplate.js
Jeff Williams 85cbed9c0c change loading process for plugins and Markdown highlighters; remove jsdoc/path
We now simply use `require()` to load plugins and Markdown highlighters.

Note that `@jsdoc/util.path.commonPrefix`, unlike `jsdoc/path.commonPrefix`, does not append `path.sep` to the return value.

Includes other minor cleanup.
2019-01-27 15:18:28 -08:00

18 lines
676 B
JavaScript

/* global jsdoc */
describe('railsTemplate plugin', () => {
const env = require('jsdoc/env');
const path = require('path');
const parser = jsdoc.createParser();
const pluginPath = path.join(env.dirname, 'plugins/railsTemplate');
require('jsdoc/plugins').installPlugins([pluginPath], parser);
require('jsdoc/src/handlers').attachTo(parser);
it('should remove <% %> rails template tags from the source of *.erb files', () => {
const docSet = parser.parse([path.join(env.dirname, 'plugins/test/fixtures/railsTemplate.js.erb')]);
expect(docSet[2].description).toEqual('Remove rails tags from the source input (e.g. )');
});
});