mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-07 14:17:16 +02:00
21 lines
578 B
JavaScript
21 lines
578 B
JavaScript
import loadDocs from '@lib/load/docs';
|
|
import path from 'path';
|
|
|
|
describe('loadDocs', () => {
|
|
test('simple docs', async () => {
|
|
const docsDir = path.join(__dirname, '__fixtures__', 'simple-docs');
|
|
const docsData = await loadDocs(docsDir);
|
|
expect(docsData).toMatchSnapshot();
|
|
expect(docsData).not.toBeNull();
|
|
});
|
|
|
|
test('no docs', async () => {
|
|
const nonExistingDocsDir = path.join(
|
|
__dirname,
|
|
'__fixtures__',
|
|
'nonExistingDocs'
|
|
);
|
|
const docsData = await loadDocs(nonExistingDocsDir);
|
|
expect(docsData).toEqual([]);
|
|
});
|
|
});
|