mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
+ Use `cosmiconfig` instead of rolling our own code (which gives us YAML support)
+ Look for the config in these locations, and in this order:
+ A `jsdoc` property in `package.json`
+ `.jsdocrc` (can be JSON or YAML; comments not allowed for JSON)
+ `.jsdocrc.json` (comments allowed)
+ `.jsdocrc.yaml`
+ `.jsdocrc.yml`
+ `.jsdocrc.js`
+ `jsdoc.config.js`
82 lines
2.3 KiB
JavaScript
82 lines
2.3 KiB
JavaScript
const defaults = require('../../defaults');
|
|
|
|
describe('@jsdoc/config/defaults', () => {
|
|
it('exists', () => {
|
|
expect(defaults).toBeObject();
|
|
});
|
|
|
|
describe('plugins', () => {
|
|
it('is an array', () => {
|
|
expect(defaults.plugins).toBeArray();
|
|
});
|
|
});
|
|
|
|
describe('source', () => {
|
|
it('is an object', () => {
|
|
expect(defaults.source).toBeObject();
|
|
});
|
|
|
|
describe('excludePattern', () => {
|
|
it('is a string', () => {
|
|
expect(defaults.source.excludePattern).toBeString();
|
|
});
|
|
|
|
it('represents a valid regexp', () => {
|
|
expect(() => new RegExp(defaults.source.excludePattern)).not.toThrow();
|
|
});
|
|
});
|
|
|
|
describe('includePattern', () => {
|
|
it('is a string', () => {
|
|
expect(defaults.source.includePattern).toBeString();
|
|
});
|
|
|
|
it('represents a valid regexp', () => {
|
|
expect(() => new RegExp(defaults.source.includePattern)).not.toThrow();
|
|
});
|
|
});
|
|
|
|
describe('type', () => {
|
|
it('is a string', () => {
|
|
expect(defaults.source.type).toBeString();
|
|
});
|
|
});
|
|
|
|
describe('tags', () => {
|
|
it('is an object', () => {
|
|
expect(defaults.tags).toBeObject();
|
|
});
|
|
|
|
describe('allowUnknownTags', () => {
|
|
it('is a boolean', () => {
|
|
expect(defaults.tags.allowUnknownTags).toBeBoolean();
|
|
});
|
|
});
|
|
|
|
describe('dictionaries', () => {
|
|
it('is an array of strings', () => {
|
|
expect(defaults.tags.dictionaries).toBeArrayOfStrings();
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('templates', () => {
|
|
it('is an object', () => {
|
|
expect(defaults.templates).toBeObject();
|
|
});
|
|
|
|
describe('cleverLinks', () => {
|
|
it('is a boolean', () => {
|
|
expect(defaults.templates.cleverLinks).toBeBoolean();
|
|
});
|
|
});
|
|
|
|
describe('monospaceLinks', () => {
|
|
it('is a boolean', () => {
|
|
expect(defaults.templates.monospaceLinks).toBeBoolean();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|