refactor(jsdoc): remove jsdoc/env dependencies from tests

This commit is contained in:
Jeff Williams 2021-09-27 16:24:27 -07:00
parent ba74ec1d4f
commit afb01782df
27 changed files with 136 additions and 145 deletions

View File

@ -2,14 +2,13 @@ const { _replaceDictionary } = require('jsdoc/doclet');
const { augmentAll } = require('jsdoc/augment');
const { createParser } = require('jsdoc/src/parser');
const { Dictionary } = require('jsdoc/tag/dictionary');
const env = require('jsdoc/env');
const { EventBus } = require('@jsdoc/util');
const fs = require('fs');
const handlers = require('jsdoc/src/handlers');
const path = require('path');
const bus = new EventBus('jsdoc');
const originalDictionaries = env.conf.tags.dictionaries.slice();
let originalDictionaries;
const parseResults = [];
const helpers = {
@ -35,6 +34,7 @@ const helpers = {
},
getDocSetFromFile: (filename, parser, shouldValidate, augment) => {
let doclets;
const env = jsdoc.deps.get('env');
const sourceCode = fs.readFileSync(path.join(env.dirname, filename), 'utf8');
const testParser = parser || helpers.createParser();
@ -65,11 +65,13 @@ const helpers = {
getParseResults: () => parseResults,
replaceTagDictionary: (dictionaryNames) => {
let dict;
const env = jsdoc.deps.get('env');
if (!Array.isArray(dictionaryNames)) {
dictionaryNames = [dictionaryNames];
}
originalDictionaries = env.conf.tags.dictionaries.slice();
env.conf.tags.dictionaries = dictionaryNames;
dict = Dictionary.fromConfig(env);
@ -79,6 +81,8 @@ const helpers = {
env.conf.tags.dictionaries = originalDictionaries;
},
restoreTagDictionary: () => {
const env = jsdoc.deps.get('env');
_replaceDictionary(Dictionary.fromConfig(env));
},
};

View File

@ -1,5 +1,4 @@
const ConsoleReporter = require('jasmine-console-reporter');
const env = require('jsdoc/env');
const Jasmine = require('jasmine');
const SCHEMA_SPEC = 'packages/jsdoc/test/specs/jsdoc/schema.js';
@ -12,7 +11,7 @@ const SPEC_FILES = [
module.exports = (deps) => {
const jasmine = new Jasmine();
const matcher = env.opts.matcher;
const matcher = deps.get('options').matcher;
/* eslint-disable no-empty-function */
const promise = new Promise(() => {});
/* eslint-enable no-empty-function */

View File

@ -1,4 +1,4 @@
const env = require('jsdoc/env');
const config = jsdoc.deps.get('config');
describe('multiple doclets per symbol', () => {
function undocumented($) {
@ -60,12 +60,12 @@ describe('multiple doclets per symbol', () => {
'When a file contains a JSDoc comment with an @also tag, and the "tags.allowUnknownTags" ' +
'option is set to false, the file can be parsed without errors.',
() => {
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
function getDocSet() {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
jsdoc.getDocSetFromFile('test/fixtures/also2.js');
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
}
expect(jsdoc.didLog(getDocSet, 'error')).toBeFalse();

View File

@ -1,8 +1,8 @@
describe('module names', () => {
const env = require('jsdoc/env');
const path = require('path');
let doclets;
const env = jsdoc.deps.get('env');
let srcParser = null;
beforeEach(() => {

View File

@ -1,10 +1,10 @@
const env = require('jsdoc/env');
const options = jsdoc.deps.get('options');
describe('multiple @param tags with the same type expression', () => {
const debug = Boolean(env.opts.debug);
const debug = Boolean(options.debug);
afterEach(() => {
env.opts.debug = debug;
options.debug = debug;
});
it('does not have circular references when type.parsedType is enumerable', () => {
@ -13,7 +13,7 @@ describe('multiple @param tags with the same type expression', () => {
let stringified;
// Force type.parsedType to be enumerable.
env.opts.debug = true;
options.debug = true;
docSet = jsdoc.getDocSetFromFile('test/fixtures/paramtagsametype.js');
params = docSet.getByLongname('foo.bar.Baz').filter((d) => !d.undocumented)[0].params;
stringified = JSON.stringify(params);

View File

@ -2,11 +2,11 @@
describe('jsdoc/src/parser', () => {
const _ = require('lodash');
const { attachTo } = require('jsdoc/src/handlers');
const env = require('jsdoc/env');
const fs = require('fs');
const jsdocParser = require('jsdoc/src/parser');
const path = require('path');
const config = jsdoc.deps.get('config');
const dirname = path.resolve(path.join(__dirname, '..', '..', '..', '..'));
it('should exist', () => {
@ -23,7 +23,7 @@ describe('jsdoc/src/parser', () => {
describe('createParser', () => {
it('should return a Parser when called with a config', () => {
expect(jsdocParser.createParser(env.conf)).toBeObject();
expect(jsdocParser.createParser(config)).toBeObject();
});
});

View File

@ -1,7 +1,7 @@
const hasOwnProp = Object.prototype.hasOwnProperty;
const options = jsdoc.deps.get('options');
describe('jsdoc/tag', () => {
const env = require('jsdoc/env');
const jsdocDictionary = require('jsdoc/tag/dictionary');
const jsdocTag = require('jsdoc/tag');
const parseType = require('@jsdoc/tag').type.parse;
@ -131,10 +131,10 @@ describe('jsdoc/tag', () => {
});
describe("'value' property", () => {
const debug = Boolean(env.opts.debug);
const debug = Boolean(options.debug);
afterEach(() => {
env.opts.debug = debug;
options.debug = debug;
});
it("'value' property should equal tag text if tagDef.canHaveType and canHaveName are both false", () => {
@ -172,13 +172,13 @@ describe('jsdoc/tag', () => {
expect(tag.value.type.parsedType).toBeObject();
descriptor = Object.getOwnPropertyDescriptor(tag.value.type, 'parsedType');
expect(descriptor.enumerable).toBe(Boolean(env.opts.debug));
expect(descriptor.enumerable).toBe(Boolean(options.debug));
}
}
it('if the tag has a type, tag.value should contain the type information', () => {
[true, false].forEach((bool) => {
env.opts.debug = bool;
options.debug = bool;
createTags();
verifyTagType(tagType);

View File

@ -1,8 +1,8 @@
describe('jsdoc/tag/dictionary', () => {
const dictionary = require('jsdoc/tag/dictionary');
const Dictionary = dictionary.Dictionary;
const env = require('jsdoc/env');
const env = jsdoc.deps.get('env');
let testDictionary;
const tagOptions = {
canHaveValue: true,

View File

@ -1,10 +1,11 @@
describe('jsdoc/tag/validator', () => {
const _ = require('lodash');
const env = require('jsdoc/env');
const { EventBus } = require('@jsdoc/util');
const tag = require('jsdoc/tag');
const validator = require('jsdoc/tag/validator');
const config = jsdoc.deps.get('config');
it('should exist', () => {
expect(validator).toBeObject();
});
@ -16,7 +17,7 @@ describe('jsdoc/tag/validator', () => {
describe('validate', () => {
const dictionary = require('jsdoc/tag/dictionary');
const allowUnknown = Boolean(env.conf.tags.allowUnknownTags);
const allowUnknown = Boolean(config.tags.allowUnknownTags);
const badTag = { title: 'lkjasdlkjfb' };
const badTag2 = new tag.Tag('type', '{string} I am a string!');
const meta = {
@ -32,12 +33,12 @@ describe('jsdoc/tag/validator', () => {
}
afterEach(() => {
env.conf.tags.allowUnknownTags = allowUnknown;
config.tags.allowUnknownTags = allowUnknown;
});
it('logs an error if the tag is not in the dictionary and conf.tags.allowUnknownTags is false', () => {
function validate() {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
validateTag(badTag);
}
@ -46,7 +47,7 @@ describe('jsdoc/tag/validator', () => {
it('logs an error if the tag is not in the dictionary and conf.tags.allowUnknownTags is does not include it', () => {
function validate() {
env.conf.tags.allowUnknownTags = [];
config.tags.allowUnknownTags = [];
validateTag(badTag);
}
@ -55,7 +56,7 @@ describe('jsdoc/tag/validator', () => {
it('does not log an error if the tag is not in the dictionary and conf.tags.allowUnknownTags is true', () => {
function validate() {
env.conf.tags.allowUnknownTags = true;
config.tags.allowUnknownTags = true;
validateTag(badTag);
}
@ -64,7 +65,7 @@ describe('jsdoc/tag/validator', () => {
it('does not log an error if the tag is not in the dictionary and conf.tags.allowUnknownTags includes it', () => {
function validate() {
env.conf.tags.allowUnknownTags = [badTag.title];
config.tags.allowUnknownTags = [badTag.title];
validateTag(badTag);
}
@ -116,7 +117,7 @@ describe('jsdoc/tag/validator', () => {
const events = [];
bus.once('logger:error', (e) => events.push(e));
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
validateTag(badTag);
expect(events[0]).toContain(meta.comment);

View File

@ -5,10 +5,12 @@ describe('jsdoc/util/templateHelper', () => {
const _ = require('lodash');
const dictionary = require('jsdoc/tag/dictionary');
const doclet = require('jsdoc/doclet');
const env = require('jsdoc/env');
const helper = require('jsdoc/util/templateHelper');
const { taffy } = require('taffydb');
const config = jsdoc.deps.get('config');
const options = jsdoc.deps.get('options');
helper.registerLink('test', 'path/to/test.html');
it('should exist', () => {
@ -1111,12 +1113,12 @@ describe('jsdoc/util/templateHelper', () => {
});
describe('prune', () => {
const access = env.opts.access;
const priv = Boolean(env.opts.private);
const access = options.access;
const priv = Boolean(options.private);
afterEach(() => {
env.opts.access = access;
env.opts.private = priv;
options.access = access;
options.private = priv;
});
const array = [
@ -1142,7 +1144,7 @@ describe('jsdoc/util/templateHelper', () => {
{ memberof: 'SomeClass' },
];
const arrayPrivate = [
// prune (unless env.opts.private is truthy)
// prune (unless options.private is truthy)
{ access: 'private' },
];
const arrayMixed = [
@ -1159,66 +1161,66 @@ describe('jsdoc/util/templateHelper', () => {
compareObjectArrays(keep, pruned);
});
it('should prune private members if env.opts.private is falsy', () => {
it('should prune private members if options.private is falsy', () => {
let pruned;
env.opts.private = false;
options.private = false;
pruned = helper.prune(taffy(arrayPrivate))().get();
compareObjectArrays([], pruned);
});
it('should only keep package-private members if env.opts.access only contains "package"', () => {
it('should only keep package-private members if options.access only contains "package"', () => {
let pruned;
const keepPackage = [{ access: 'package' }];
env.opts.access = 'package';
options.access = 'package';
pruned = helper.prune(taffy(arrayMixed))().get();
compareObjectArrays(keepPackage, pruned);
});
it('should only keep public members if env.opts.access only contains "public"', () => {
it('should only keep public members if options.access only contains "public"', () => {
let pruned;
const keepPublic = [{ access: 'public' }];
env.opts.access = 'public';
options.access = 'public';
pruned = helper.prune(taffy(arrayMixed))().get();
compareObjectArrays(keepPublic, pruned);
});
it('should only keep undefined members if env.opts.access only contains "undefined"', () => {
it('should only keep undefined members if options.access only contains "undefined"', () => {
let pruned;
const keepUndefined = [{ asdf: true }];
env.opts.access = 'undefined';
options.access = 'undefined';
pruned = helper.prune(taffy(arrayMixed))().get();
compareObjectArrays(keepUndefined, pruned);
});
it('should only keep protected members if env.opts.access only contains "protected"', () => {
it('should only keep protected members if options.access only contains "protected"', () => {
let pruned;
const keepProtected = [{ access: 'protected' }];
env.opts.access = 'protected';
options.access = 'protected';
pruned = helper.prune(taffy(arrayMixed))().get();
compareObjectArrays(keepProtected, pruned);
});
it('should only keep private members if env.opts.access only contains "private"', () => {
it('should only keep private members if options.access only contains "private"', () => {
let pruned;
const keepPrivate = [{ access: 'private' }];
env.opts.access = 'private';
options.access = 'private';
pruned = helper.prune(taffy(arrayMixed))().get();
compareObjectArrays(keepPrivate, pruned);
});
it('should keep public and protected members if env.opts.access contains "public" and "protected"', () => {
it('should keep public and protected members if options.access contains "public" and "protected"', () => {
let pruned;
const keepPublicProtected = [
{
@ -1229,25 +1231,25 @@ describe('jsdoc/util/templateHelper', () => {
},
];
env.opts.access = ['public', 'protected'];
options.access = ['public', 'protected'];
pruned = helper.prune(taffy(arrayMixed))().get();
compareObjectArrays(keepPublicProtected, pruned);
});
it('should keep everything if env.opts.access contains "all"', () => {
it('should keep everything if options.access contains "all"', () => {
let pruned;
env.opts.access = 'all';
options.access = 'all';
pruned = helper.prune(taffy(arrayMixed))().get();
compareObjectArrays(arrayMixed, pruned);
});
it('should not prune private members if env.opts.private is truthy', () => {
it('should not prune private members if options.private is truthy', () => {
let pruned;
env.opts.private = true;
options.private = true;
pruned = helper.prune(taffy(arrayPrivate))().get();
compareObjectArrays(arrayPrivate, pruned);
@ -1276,11 +1278,11 @@ describe('jsdoc/util/templateHelper', () => {
let conf;
beforeEach(() => {
conf = _.cloneDeep(env.conf.templates);
conf = _.cloneDeep(config.templates);
});
afterEach(() => {
env.conf.templates = conf;
config.templates = conf;
delete helper.longnameToUrl['my.long.namespace'];
});
@ -1441,7 +1443,7 @@ describe('jsdoc/util/templateHelper', () => {
const input = 'Link to {@link test}';
let output;
env.conf.templates.monospaceLinks = true;
config.templates.monospaceLinks = true;
output = helper.resolveLinks(input);
expect(output).toBe('Link to <a href="path/to/test.html"><code>test</code></a>');
@ -1452,7 +1454,7 @@ describe('jsdoc/util/templateHelper', () => {
const input = 'Link to {@linkcode test}';
let output;
env.conf.templates.monospaceLinks = true;
config.templates.monospaceLinks = true;
output = helper.resolveLinks(input);
expect(output).toBe('Link to <a href="path/to/test.html"><code>test</code></a>');
@ -1462,7 +1464,7 @@ describe('jsdoc/util/templateHelper', () => {
const input = 'Link to {@linkplain test}';
let output;
env.conf.templates.monospaceLinks = true;
config.templates.monospaceLinks = true;
output = helper.resolveLinks(input);
expect(output).toBe('Link to <a href="path/to/test.html">test</a>');
@ -1474,7 +1476,7 @@ describe('jsdoc/util/templateHelper', () => {
const input = 'Link to {@link test}';
let output;
env.conf.templates.cleverLinks = true;
config.templates.cleverLinks = true;
output = helper.resolveLinks(input);
expect(output).toBe('Link to <a href="path/to/test.html"><code>test</code></a>');
@ -1484,7 +1486,7 @@ describe('jsdoc/util/templateHelper', () => {
const input = 'Link to {@link http://github.com}';
let output;
env.conf.templates.cleverLinks = true;
config.templates.cleverLinks = true;
output = helper.resolveLinks(input);
expect(output).toBe('Link to <a href="http://github.com">http://github.com</a>');
@ -1495,7 +1497,7 @@ describe('jsdoc/util/templateHelper', () => {
const input = 'Link to {@linkcode test}';
let output;
env.conf.templates.cleverLinks = true;
config.templates.cleverLinks = true;
output = helper.resolveLinks(input);
expect(output).toBe('Link to <a href="path/to/test.html"><code>test</code></a>');
@ -1505,7 +1507,7 @@ describe('jsdoc/util/templateHelper', () => {
const input = 'Link to {@linkplain test}';
let output;
env.conf.templates.cleverLinks = true;
config.templates.cleverLinks = true;
output = helper.resolveLinks(input);
expect(output).toBe('Link to <a href="path/to/test.html">test</a>');
@ -1517,8 +1519,8 @@ describe('jsdoc/util/templateHelper', () => {
const input = 'Link to {@link test} and {@link http://github.com}';
let output;
env.conf.templates.cleverLinks = true;
env.conf.templates.monospaceLinks = true;
config.templates.cleverLinks = true;
config.templates.monospaceLinks = true;
output = helper.resolveLinks(input);
expect(output).toBe(
@ -1531,7 +1533,7 @@ describe('jsdoc/util/templateHelper', () => {
const input = 'Link to {@link my.long.namespace}';
let output;
env.conf.templates.useShortNamesInLinks = true;
config.templates.useShortNamesInLinks = true;
helper.registerLink('my.long.namespace', 'asdf.html');
output = helper.resolveLinks(input);

View File

@ -1,17 +1,17 @@
describe('@define tag', () => {
describe('JSDoc tags', () => {
const env = require('jsdoc/env');
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
it('should not recognize the @define tag', () => {
function getDocSet() {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
jsdoc.replaceTagDictionary('jsdoc');
jsdoc.getDocSetFromFile('test/fixtures/definetag.js');
}

View File

@ -1,15 +1,14 @@
describe('@dict tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@export tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@externs tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@implicitCast tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@noalias tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@nocollapse tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@nocompile tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,19 +1,18 @@
describe('@override tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
function ignored({ ignore }) {
return ignore !== true;
}
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,8 +1,8 @@
describe('@overview tag', () => {
const env = require('jsdoc/env');
const path = require('path');
let doclets;
const env = jsdoc.deps.get('env');
let srcParser;
const sourceFiles = env.sourceFiles.slice(0);

View File

@ -1,15 +1,14 @@
describe('@polymerBehavior tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@polymer tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@preserve tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@struct tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@suppress tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@template tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {

View File

@ -1,15 +1,14 @@
describe('@unrestricted tag', () => {
const env = require('jsdoc/env');
const allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
const config = jsdoc.deps.get('config');
const allowUnknownTags = Boolean(config.tags.allowUnknownTags);
beforeEach(() => {
env.conf.tags.allowUnknownTags = false;
config.tags.allowUnknownTags = false;
});
afterEach(() => {
jsdoc.restoreTagDictionary();
env.conf.tags.allowUnknownTags = allowUnknownTags;
config.tags.allowUnknownTags = allowUnknownTags;
});
describe('JSDoc tags', () => {