mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-06 05:37:16 +02:00
17 lines
561 B
JavaScript
17 lines
561 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([]);
|
|
});
|
|
});
|