mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-04 01:09:20 +02:00
test: loadPages
This commit is contained in:
parent
988232edd4
commit
2141e6ea90
3 changed files with 11 additions and 31 deletions
|
@ -1,24 +0,0 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`loadDocs simple docs 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
"id": "hello",
|
||||
"path": "/hello",
|
||||
"source": "hello.md",
|
||||
"title": "Hello, World !",
|
||||
},
|
||||
Object {
|
||||
"id": "bar",
|
||||
"path": "/foo/bar",
|
||||
"source": "foo/bar.md",
|
||||
"title": "Bar",
|
||||
},
|
||||
Object {
|
||||
"id": "baz",
|
||||
"path": "/foo/baz",
|
||||
"source": "foo/baz.md",
|
||||
"title": "baz",
|
||||
},
|
||||
]
|
||||
`;
|
|
@ -2,21 +2,21 @@
|
|||
|
||||
exports[`loadPages valid pages 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
"path": "/",
|
||||
"source": "index.js",
|
||||
},
|
||||
Object {
|
||||
"path": "/foo",
|
||||
"source": "foo.js",
|
||||
},
|
||||
Object {
|
||||
"path": "/bar/baz",
|
||||
"source": "bar/baz.js",
|
||||
"path": "/",
|
||||
"source": "index.js",
|
||||
},
|
||||
Object {
|
||||
"path": "/foo/",
|
||||
"source": "foo/index.js",
|
||||
},
|
||||
Object {
|
||||
"path": "/bar/baz",
|
||||
"source": "bar/baz.js",
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
|
|
@ -3,7 +3,11 @@ import path from 'path';
|
|||
|
||||
describe('loadPages', () => {
|
||||
test('valid pages', async () => {
|
||||
const pagesDir = path.join(__dirname, '__fixtures__', 'simple-pages');
|
||||
const pagesDir = path.join(
|
||||
__dirname,
|
||||
'__fixtures__',
|
||||
'simple-pages'
|
||||
);
|
||||
const pagesData = await loadPages(pagesDir);
|
||||
expect(pagesData).toMatchSnapshot();
|
||||
expect(pagesData).not.toBeNull();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue