mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 17:07:08 +02:00
Prettify all JavaScript files (#964)
* Prettify all JavaScript files * Make trailingComma all * Delete v2/.prettierignore * Remove v2 Prettier commands in package.json
This commit is contained in:
parent
a1de6dab04
commit
9d4a5d5359
101 changed files with 441 additions and 473 deletions
|
@ -5,75 +5,75 @@ describe('createOrder', () => {
|
|||
const result = createOrder({
|
||||
docs: {
|
||||
Category1: ['doc1', 'doc2'],
|
||||
Category2: ['doc3', 'doc4']
|
||||
Category2: ['doc3', 'doc4'],
|
||||
},
|
||||
otherDocs: {
|
||||
Category1: ['doc5']
|
||||
}
|
||||
Category1: ['doc5'],
|
||||
},
|
||||
});
|
||||
expect(result).toEqual({
|
||||
doc1: {
|
||||
category: 'Category1',
|
||||
next: 'doc2',
|
||||
previous: undefined,
|
||||
sidebar: 'docs'
|
||||
sidebar: 'docs',
|
||||
},
|
||||
doc2: {
|
||||
category: 'Category1',
|
||||
next: 'doc3',
|
||||
previous: 'doc1',
|
||||
sidebar: 'docs'
|
||||
sidebar: 'docs',
|
||||
},
|
||||
doc3: {
|
||||
category: 'Category2',
|
||||
next: 'doc4',
|
||||
previous: 'doc2',
|
||||
sidebar: 'docs'
|
||||
sidebar: 'docs',
|
||||
},
|
||||
doc4: {
|
||||
category: 'Category2',
|
||||
next: undefined,
|
||||
previous: 'doc3',
|
||||
sidebar: 'docs'
|
||||
sidebar: 'docs',
|
||||
},
|
||||
doc5: {
|
||||
category: 'Category1',
|
||||
next: undefined,
|
||||
previous: undefined,
|
||||
sidebar: 'otherDocs'
|
||||
}
|
||||
sidebar: 'otherDocs',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
test('should resolve docs from older versions', () => {
|
||||
const result = createOrder({
|
||||
docs: {
|
||||
Category1: ['doc1']
|
||||
Category1: ['doc1'],
|
||||
},
|
||||
'version-1.2.3-docs': {
|
||||
Category1: ['version-1.2.3-doc2'],
|
||||
Category2: ['version-1.2.3-doc1']
|
||||
}
|
||||
Category2: ['version-1.2.3-doc1'],
|
||||
},
|
||||
});
|
||||
expect(result).toEqual({
|
||||
doc1: {
|
||||
category: 'Category1',
|
||||
next: undefined,
|
||||
previous: undefined,
|
||||
sidebar: 'docs'
|
||||
sidebar: 'docs',
|
||||
},
|
||||
'version-1.2.3-doc1': {
|
||||
category: 'Category2',
|
||||
next: undefined,
|
||||
previous: 'version-1.2.3-doc2',
|
||||
sidebar: 'version-1.2.3-docs'
|
||||
sidebar: 'version-1.2.3-docs',
|
||||
},
|
||||
'version-1.2.3-doc2': {
|
||||
category: 'Category1',
|
||||
next: 'version-1.2.3-doc1',
|
||||
previous: undefined,
|
||||
sidebar: 'version-1.2.3-docs'
|
||||
}
|
||||
sidebar: 'version-1.2.3-docs',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue