jsdoc/plugins/test/specs/commentConvert.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

20 lines
676 B
JavaScript

/* global jsdoc */
describe('commentConvert plugin', () => {
const env = require('jsdoc/env');
const path = require('path');
let docSet;
const parser = jsdoc.createParser();
const pluginPath = 'plugins/commentConvert';
const pluginPathResolved = path.join(env.dirname, pluginPath);
require('jsdoc/plugins').installPlugins([pluginPathResolved], parser);
docSet = jsdoc.getDocSetFromFile(`${pluginPath}.js`, parser);
it('should convert ///-style comments into jsdoc comments', () => {
const doclet = docSet.getByLongname('module:plugins/commentConvert.handlers.beforeParse');
expect(doclet.length).toEqual(1);
});
});