mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-21 10:37:51 +02:00
feat:docs translation + versioning 💥
This commit is contained in:
parent
31d333b82f
commit
0f38ae3979
20 changed files with 1133 additions and 520 deletions
|
@ -1,39 +1,24 @@
|
|||
import genRoutesConfig from '@lib/load/routes';
|
||||
import loadDocs from '@lib/load/docs';
|
||||
import loadPages from '@lib/load/pages';
|
||||
import path from 'path';
|
||||
import loadSetup from '../loadSetup';
|
||||
|
||||
describe('genRoutesConfig', () => {
|
||||
const pagesDir = path.join(__dirname, '__fixtures__', 'simple-pages');
|
||||
const docsDir = path.join(__dirname, '__fixtures__', 'simple-docs');
|
||||
|
||||
test('website with pages and docs', async () => {
|
||||
const props = {
|
||||
docsData: await loadDocs(docsDir),
|
||||
pagesData: await loadPages(pagesDir)
|
||||
};
|
||||
const routes = await genRoutesConfig(props);
|
||||
expect(routes).toMatchSnapshot();
|
||||
test('simple website', async () => {
|
||||
const props = await loadSetup('simple');
|
||||
await genRoutesConfig(props);
|
||||
});
|
||||
|
||||
test('website with only pages', async () => {
|
||||
const props = {
|
||||
pagesData: await loadPages(pagesDir)
|
||||
};
|
||||
const routes = await genRoutesConfig(props);
|
||||
expect(routes).toMatchSnapshot();
|
||||
test('versioned website', async () => {
|
||||
const props = await loadSetup('versioned');
|
||||
await genRoutesConfig(props);
|
||||
});
|
||||
|
||||
test('website with only docs', async () => {
|
||||
const props = {
|
||||
docsData: await loadDocs(docsDir)
|
||||
};
|
||||
const routes = await genRoutesConfig(props);
|
||||
expect(routes).toMatchSnapshot();
|
||||
test('versioned & translated website', async () => {
|
||||
const props = await loadSetup('transversioned');
|
||||
await genRoutesConfig(props);
|
||||
});
|
||||
|
||||
test('website with no docs/pages', async () => {
|
||||
const routes = await genRoutesConfig({});
|
||||
expect(routes).toMatchSnapshot();
|
||||
test('translated website', async () => {
|
||||
const props = await loadSetup('translated');
|
||||
await genRoutesConfig(props);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue