mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-28 00:17:14 +02:00
test: fix inconsistent test
This commit is contained in:
parent
0f38ae3979
commit
0cef519e7f
3 changed files with 389 additions and 569 deletions
|
@ -4,12 +4,17 @@ import path from 'path';
|
|||
describe('loadPages', () => {
|
||||
test('valid pages', async () => {
|
||||
const pagesDir = path.join(__dirname, '__fixtures__', 'simple-pages');
|
||||
const pagesData = await loadPages(pagesDir);
|
||||
let pagesData = await loadPages(pagesDir);
|
||||
pagesData.sort((a, b) => a.path > b.path); // because it was unordered
|
||||
expect(pagesData).toEqual([
|
||||
{
|
||||
path: '/',
|
||||
source: 'index.js'
|
||||
},
|
||||
{
|
||||
path: '/bar/baz',
|
||||
source: 'bar/baz.js'
|
||||
},
|
||||
{
|
||||
path: '/foo',
|
||||
source: 'foo.js'
|
||||
|
@ -17,10 +22,6 @@ describe('loadPages', () => {
|
|||
{
|
||||
path: '/foo/',
|
||||
source: 'foo/index.js'
|
||||
},
|
||||
{
|
||||
path: '/bar/baz',
|
||||
source: 'bar/baz.js'
|
||||
}
|
||||
]);
|
||||
expect(pagesData).not.toBeNull();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue