mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-16 16:25:56 +02:00
test: load docs
This commit is contained in:
parent
bf94bf96f8
commit
d80a2555c0
5 changed files with 228 additions and 0 deletions
21
test/load/docs.test.js
Normal file
21
test/load/docs.test.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
import loadDocs from '@lib/load/docs.js';
|
||||
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([]);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue