mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
fix(v2): handle non existent blog, docs, pages (#1459)
* fix(v2): handle non existent blog, docs, pages * nits
This commit is contained in:
parent
f84abfe2d1
commit
55d7920825
5 changed files with 41 additions and 12 deletions
|
@ -12,18 +12,18 @@ import loadSidebars from '../sidebars';
|
|||
|
||||
describe('loadSidebars', () => {
|
||||
test('normal site with sidebars', async () => {
|
||||
const sidebar = require(path.join(
|
||||
const sidebarPath = path.join(
|
||||
__dirname,
|
||||
'__fixtures__',
|
||||
'website',
|
||||
'sidebars.json',
|
||||
));
|
||||
const result = loadSidebars({sidebar});
|
||||
);
|
||||
const result = loadSidebars(sidebarPath);
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('site without sidebars', () => {
|
||||
const result = loadSidebars({sidebar: {}});
|
||||
const result = loadSidebars(null);
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue