mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-07 14:17:16 +02:00
21 lines
585 B
JavaScript
21 lines
585 B
JavaScript
import loadPages from '@lib/load/pages';
|
|
import path from 'path';
|
|
|
|
describe('loadPages', () => {
|
|
test('valid pages', async () => {
|
|
const pagesDir = path.join(
|
|
__dirname,
|
|
'__fixtures__',
|
|
'simple-pages'
|
|
);
|
|
const pagesData = await loadPages(pagesDir);
|
|
expect(pagesData).toMatchSnapshot();
|
|
expect(pagesData).not.toBeNull();
|
|
});
|
|
|
|
test('invalid pages', async () => {
|
|
const nonExistingDir = path.join(__dirname, '__fixtures__', 'nonExisting');
|
|
const pagesData = await loadPages(nonExistingDir);
|
|
expect(pagesData).toEqual([]);
|
|
});
|
|
});
|