mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-30 09:27:04 +02:00
feat(v2): add disableVersioning config to docs plugin (#2989)
* add disableVersioning config to docs plugin * fix test * fix test
This commit is contained in:
parent
9265de982b
commit
a5b2b6056b
8 changed files with 44 additions and 16 deletions
|
@ -24,6 +24,13 @@ describe('loadEnv', () => {
|
|||
expect(env.versioning.versions).toStrictEqual(['1.0.1', '1.0.0']);
|
||||
});
|
||||
|
||||
test('website with versioning but disabled', () => {
|
||||
const siteDir = path.join(__dirname, '__fixtures__', 'versioned-site');
|
||||
const env = loadEnv(siteDir, {disableVersioning: true});
|
||||
expect(env.versioning.enabled).toBe(false);
|
||||
expect(env.versioning.versions).toStrictEqual([]);
|
||||
});
|
||||
|
||||
test('website with invalid versions.json file', () => {
|
||||
const siteDir = path.join(__dirname, '__fixtures__', 'versioned-site');
|
||||
const mock = jest.spyOn(JSON, 'parse').mockImplementationOnce(() => {
|
||||
|
|
|
@ -39,6 +39,7 @@ describe('normalizeDocsPluginOptions', () => {
|
|||
showLastUpdateAuthor: true,
|
||||
admonitions: {},
|
||||
excludeNextVersionDocs: true,
|
||||
disableVersioning: true,
|
||||
};
|
||||
|
||||
const {value} = await PluginOptionSchema.validate(userOptions);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue