chore: do not print prototype in jest snapshot (#6908)

This commit is contained in:
Joshua Chen 2022-03-13 19:34:50 +08:00 committed by GitHub
parent 3a4b9b4c30
commit 8c1e518ba2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 1536 additions and 1519 deletions

View file

@ -25,13 +25,14 @@ const ignorePatterns = [
export default { export default {
rootDir: fileURLToPath(new URL('.', import.meta.url)), rootDir: fileURLToPath(new URL('.', import.meta.url)),
verbose: true, verbose: true,
testURL: 'http://localhost/', testURL: 'https://docusaurus.io/',
testEnvironment: 'node', testEnvironment: 'node',
testPathIgnorePatterns: ignorePatterns, testPathIgnorePatterns: ignorePatterns,
coveragePathIgnorePatterns: ignorePatterns, coveragePathIgnorePatterns: ignorePatterns,
transform: { transform: {
'^.+\\.[jt]sx?$': 'babel-jest', '^.+\\.[jt]sx?$': 'babel-jest',
}, },
errorOnDeprecated: true,
moduleNameMapper: { moduleNameMapper: {
// Jest can't resolve CSS or asset imports // Jest can't resolve CSS or asset imports
'^.+\\.(css|jpe?g|png|svg)$': '<rootDir>/jest/emptyModule.js', '^.+\\.(css|jpe?g|png|svg)$': '<rootDir>/jest/emptyModule.js',
@ -49,10 +50,8 @@ export default {
'@docusaurus/plugin-content-docs/client': '@docusaurus/plugin-content-docs/client':
'@docusaurus/plugin-content-docs/src/client/index.ts', '@docusaurus/plugin-content-docs/src/client/index.ts',
}, },
globals: {
window: {
location: {href: 'https://docusaurus.io'},
},
},
snapshotSerializers: ['<rootDir>/jest/snapshotPathNormalizer.js'], snapshotSerializers: ['<rootDir>/jest/snapshotPathNormalizer.js'],
snapshotFormat: {
printBasicPrototype: false,
},
}; };

View file

@ -1,68 +1,68 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`error prints objects 1`] = ` exports[`error prints objects 1`] = `
Array [ [
Array [ [
"[ERROR] {\\"a\\":1}", "[ERROR] {\\"a\\":1}",
], ],
Array [ [
"[ERROR] undefined", "[ERROR] undefined",
], ],
Array [ [
"[ERROR] 1,2,3", "[ERROR] 1,2,3",
], ],
Array [ [
"[ERROR] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)", "[ERROR] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)",
], ],
] ]
`; `;
exports[`info prints objects 1`] = ` exports[`info prints objects 1`] = `
Array [ [
Array [ [
"[INFO] {\\"a\\":1}", "[INFO] {\\"a\\":1}",
], ],
Array [ [
"[INFO] undefined", "[INFO] undefined",
], ],
Array [ [
"[INFO] 1,2,3", "[INFO] 1,2,3",
], ],
Array [ [
"[INFO] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)", "[INFO] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)",
], ],
] ]
`; `;
exports[`success prints objects 1`] = ` exports[`success prints objects 1`] = `
Array [ [
Array [ [
"[SUCCESS] {\\"a\\":1}", "[SUCCESS] {\\"a\\":1}",
], ],
Array [ [
"[SUCCESS] undefined", "[SUCCESS] undefined",
], ],
Array [ [
"[SUCCESS] 1,2,3", "[SUCCESS] 1,2,3",
], ],
Array [ [
"[SUCCESS] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)", "[SUCCESS] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)",
], ],
] ]
`; `;
exports[`warn prints objects 1`] = ` exports[`warn prints objects 1`] = `
Array [ [
Array [ [
"[WARNING] {\\"a\\":1}", "[WARNING] {\\"a\\":1}",
], ],
Array [ [
"[WARNING] undefined", "[WARNING] undefined",
], ],
Array [ [
"[WARNING] 1,2,3", "[WARNING] 1,2,3",
], ],
Array [ [
"[WARNING] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)", "[WARNING] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)",
], ],
] ]

View file

@ -96,19 +96,19 @@ cmd /C 'set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy'
`; `;
exports[`unwrapMdxCodeBlocks remark plugin unwraps the mdx code blocks AST 1`] = ` exports[`unwrapMdxCodeBlocks remark plugin unwraps the mdx code blocks AST 1`] = `
Object { {
"children": Array [ "children": [
Object { {
"children": Array [ "children": [
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 32, "column": 32,
"line": 1, "line": 1,
"offset": 31, "offset": 31,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 3, "column": 3,
"line": 1, "line": 1,
"offset": 2, "offset": 2,
@ -120,13 +120,13 @@ Object {
], ],
"depth": 1, "depth": 1,
"position": Position { "position": Position {
"end": Object { "end": {
"column": 32, "column": 32,
"line": 1, "line": 1,
"offset": 31, "offset": 31,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 1, "line": 1,
"offset": 0, "offset": 0,
@ -134,17 +134,17 @@ Object {
}, },
"type": "heading", "type": "heading",
}, },
Object { {
"children": Array [ "children": [
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 23, "column": 23,
"line": 3, "line": 3,
"offset": 55, "offset": 55,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 4, "column": 4,
"line": 3, "line": 3,
"offset": 36, "offset": 36,
@ -156,13 +156,13 @@ Object {
], ],
"depth": 2, "depth": 2,
"position": Position { "position": Position {
"end": Object { "end": {
"column": 23, "column": 23,
"line": 3, "line": 3,
"offset": 55, "offset": 55,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 3, "line": 3,
"offset": 33, "offset": 33,
@ -170,17 +170,17 @@ Object {
}, },
"type": "heading", "type": "heading",
}, },
Object { {
"children": Array [ "children": [
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 5, "column": 5,
"line": 5, "line": 5,
"offset": 61, "offset": 61,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 5, "line": 5,
"offset": 57, "offset": 57,
@ -191,13 +191,13 @@ Object {
}, },
], ],
"position": Position { "position": Position {
"end": Object { "end": {
"column": 5, "column": 5,
"line": 5, "line": 5,
"offset": 61, "offset": 61,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 5, "line": 5,
"offset": 57, "offset": 57,
@ -205,19 +205,19 @@ Object {
}, },
"type": "paragraph", "type": "paragraph",
}, },
Object { {
"children": Array [ "children": [
Object { {
"children": Array [ "children": [
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 6, "column": 6,
"line": 7, "line": 7,
"offset": 68, "offset": 68,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 2, "column": 2,
"line": 7, "line": 7,
"offset": 64, "offset": 64,
@ -228,13 +228,13 @@ Object {
}, },
], ],
"position": Position { "position": Position {
"end": Object { "end": {
"column": 29, "column": 29,
"line": 7, "line": 7,
"offset": 91, "offset": 91,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 7, "line": 7,
"offset": 63, "offset": 63,
@ -246,13 +246,13 @@ Object {
}, },
], ],
"position": Position { "position": Position {
"end": Object { "end": {
"column": 29, "column": 29,
"line": 7, "line": 7,
"offset": 91, "offset": 91,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 7, "line": 7,
"offset": 63, "offset": 63,
@ -260,19 +260,19 @@ Object {
}, },
"type": "paragraph", "type": "paragraph",
}, },
Object { {
"children": Array [ "children": [
Object { {
"children": Array [ "children": [
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 7, "column": 7,
"line": 9, "line": 9,
"offset": 99, "offset": 99,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 3, "column": 3,
"line": 9, "line": 9,
"offset": 95, "offset": 95,
@ -283,13 +283,13 @@ Object {
}, },
], ],
"position": Position { "position": Position {
"end": Object { "end": {
"column": 9, "column": 9,
"line": 9, "line": 9,
"offset": 101, "offset": 101,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 9, "line": 9,
"offset": 93, "offset": 93,
@ -299,13 +299,13 @@ Object {
}, },
], ],
"position": Position { "position": Position {
"end": Object { "end": {
"column": 9, "column": 9,
"line": 9, "line": 9,
"offset": 101, "offset": 101,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 9, "line": 9,
"offset": 93, "offset": 93,
@ -313,18 +313,18 @@ Object {
}, },
"type": "paragraph", "type": "paragraph",
}, },
Object { {
"children": Array [ "children": [
Object { {
"alt": "image", "alt": "image",
"position": Position { "position": Position {
"end": Object { "end": {
"column": 43, "column": 43,
"line": 11, "line": 11,
"offset": 145, "offset": 145,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 11, "line": 11,
"offset": 103, "offset": 103,
@ -336,13 +336,13 @@ Object {
}, },
], ],
"position": Position { "position": Position {
"end": Object { "end": {
"column": 43, "column": 43,
"line": 11, "line": 11,
"offset": 145, "offset": 145,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 11, "line": 11,
"offset": 103, "offset": 103,
@ -350,17 +350,17 @@ Object {
}, },
"type": "paragraph", "type": "paragraph",
}, },
Object { {
"children": Array [ "children": [
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 18, "column": 18,
"line": 13, "line": 13,
"offset": 164, "offset": 164,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 4, "column": 4,
"line": 13, "line": 13,
"offset": 150, "offset": 150,
@ -372,13 +372,13 @@ Object {
], ],
"depth": 2, "depth": 2,
"position": Position { "position": Position {
"end": Object { "end": {
"column": 18, "column": 18,
"line": 13, "line": 13,
"offset": 164, "offset": 164,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 13, "line": 13,
"offset": 147, "offset": 147,
@ -386,15 +386,15 @@ Object {
}, },
"type": "heading", "type": "heading",
}, },
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 23, "column": 23,
"line": 15, "line": 15,
"offset": 188, "offset": 188,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 15, "line": 15,
"offset": 166, "offset": 166,
@ -403,18 +403,18 @@ Object {
"type": "import", "type": "import",
"value": "import XYZ from 'xyz';", "value": "import XYZ from 'xyz';",
}, },
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 7, "column": 7,
"line": 19, "line": 19,
"offset": 287, "offset": 287,
}, },
"indent": Array [ "indent": [
1, 1,
1, 1,
], ],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 17, "line": 17,
"offset": 190, "offset": 190,
@ -425,17 +425,17 @@ Object {
<span>Test</span> <span>Test</span>
</XYZ>", </XYZ>",
}, },
Object { {
"children": Array [ "children": [
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 29, "column": 29,
"line": 21, "line": 21,
"offset": 317, "offset": 317,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 4, "column": 4,
"line": 21, "line": 21,
"offset": 292, "offset": 292,
@ -447,13 +447,13 @@ Object {
], ],
"depth": 2, "depth": 2,
"position": Position { "position": Position {
"end": Object { "end": {
"column": 29, "column": 29,
"line": 21, "line": 21,
"offset": 317, "offset": 317,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 21, "line": 21,
"offset": 289, "offset": 289,
@ -461,16 +461,16 @@ Object {
}, },
"type": "heading", "type": "heading",
}, },
Object { {
"lang": "mdx-code-block", "lang": "mdx-code-block",
"meta": null, "meta": null,
"position": Position { "position": Position {
"end": Object { "end": {
"column": 4, "column": 4,
"line": 29, "line": 29,
"offset": 442, "offset": 442,
}, },
"indent": Array [ "indent": [
1, 1,
1, 1,
1, 1,
@ -478,7 +478,7 @@ Object {
1, 1,
1, 1,
], ],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 23, "line": 23,
"offset": 319, "offset": 319,
@ -491,17 +491,17 @@ Object {
<div>Sebastien Lorber</div> <div>Sebastien Lorber</div>
</Avatar>", </Avatar>",
}, },
Object { {
"children": Array [ "children": [
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 44, "column": 44,
"line": 31, "line": 31,
"offset": 487, "offset": 487,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 4, "column": 4,
"line": 31, "line": 31,
"offset": 447, "offset": 447,
@ -513,13 +513,13 @@ Object {
], ],
"depth": 2, "depth": 2,
"position": Position { "position": Position {
"end": Object { "end": {
"column": 44, "column": 44,
"line": 31, "line": 31,
"offset": 487, "offset": 487,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 31, "line": 31,
"offset": 444, "offset": 444,
@ -527,14 +527,14 @@ Object {
}, },
"type": "heading", "type": "heading",
}, },
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 25, "column": 25,
"line": 40, "line": 40,
"offset": 688, "offset": 688,
}, },
"indent": Array [ "indent": [
1, 1,
1, 1,
1, 1,
@ -543,7 +543,7 @@ Object {
1, 1,
1, 1,
], ],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 33, "line": 33,
"offset": 489, "offset": 489,
@ -559,20 +559,20 @@ Object {
]}> ]}>
<TabItem value=\\"bash\\">", <TabItem value=\\"bash\\">",
}, },
Object { {
"lang": "bash", "lang": "bash",
"meta": null, "meta": null,
"position": Position { "position": Position {
"end": Object { "end": {
"column": 4, "column": 4,
"line": 44, "line": 44,
"offset": 740, "offset": 740,
}, },
"indent": Array [ "indent": [
1, 1,
1, 1,
], ],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 42, "line": 42,
"offset": 690, "offset": 690,
@ -581,17 +581,17 @@ Object {
"type": "code", "type": "code",
"value": "GIT_USER=<GITHUB_USERNAME> yarn deploy", "value": "GIT_USER=<GITHUB_USERNAME> yarn deploy",
}, },
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 28, "column": 28,
"line": 47, "line": 47,
"offset": 782, "offset": 782,
}, },
"indent": Array [ "indent": [
1, 1,
], ],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 46, "line": 46,
"offset": 742, "offset": 742,
@ -601,20 +601,20 @@ Object {
"value": " </TabItem> "value": " </TabItem>
<TabItem value=\\"windows\\">", <TabItem value=\\"windows\\">",
}, },
Object { {
"lang": null, "lang": null,
"meta": null, "meta": null,
"position": Position { "position": Position {
"end": Object { "end": {
"column": 8, "column": 8,
"line": 51, "line": 51,
"offset": 865, "offset": 865,
}, },
"indent": Array [ "indent": [
1, 1,
1, 1,
], ],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 49, "line": 49,
"offset": 784, "offset": 784,
@ -625,17 +625,17 @@ Object {
cmd /C \\"set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy\\" cmd /C \\"set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy\\"
\`\`\`", \`\`\`",
}, },
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 31, "column": 31,
"line": 54, "line": 54,
"offset": 910, "offset": 910,
}, },
"indent": Array [ "indent": [
1, 1,
], ],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 53, "line": 53,
"offset": 867, "offset": 867,
@ -645,20 +645,20 @@ cmd /C \\"set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy\\"
"value": " </TabItem> "value": " </TabItem>
<TabItem value=\\"powershell\\">", <TabItem value=\\"powershell\\">",
}, },
Object { {
"lang": "powershell", "lang": "powershell",
"meta": null, "meta": null,
"position": Position { "position": Position {
"end": Object { "end": {
"column": 4, "column": 4,
"line": 58, "line": 58,
"offset": 986, "offset": 986,
}, },
"indent": Array [ "indent": [
1, 1,
1, 1,
], ],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 56, "line": 56,
"offset": 912, "offset": 912,
@ -667,17 +667,17 @@ cmd /C \\"set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy\\"
"type": "code", "type": "code",
"value": "cmd /C 'set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy'", "value": "cmd /C 'set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy'",
}, },
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 8, "column": 8,
"line": 61, "line": 61,
"offset": 1008, "offset": 1008,
}, },
"indent": Array [ "indent": [
1, 1,
], ],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 60, "line": 60,
"offset": 988, "offset": 988,
@ -687,17 +687,17 @@ cmd /C \\"set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy\\"
"value": " </TabItem> "value": " </TabItem>
</Tabs>", </Tabs>",
}, },
Object { {
"children": Array [ "children": [
Object { {
"position": Position { "position": Position {
"end": Object { "end": {
"column": 55, "column": 55,
"line": 63, "line": 63,
"offset": 1064, "offset": 1064,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 4, "column": 4,
"line": 63, "line": 63,
"offset": 1013, "offset": 1013,
@ -709,13 +709,13 @@ cmd /C \\"set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy\\"
], ],
"depth": 2, "depth": 2,
"position": Position { "position": Position {
"end": Object { "end": {
"column": 55, "column": 55,
"line": 63, "line": 63,
"offset": 1064, "offset": 1064,
}, },
"indent": Array [], "indent": [],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 63, "line": 63,
"offset": 1010, "offset": 1010,
@ -723,16 +723,16 @@ cmd /C \\"set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy\\"
}, },
"type": "heading", "type": "heading",
}, },
Object { {
"lang": "mdx-code-block", "lang": "mdx-code-block",
"meta": null, "meta": null,
"position": Position { "position": Position {
"end": Object { "end": {
"column": 5, "column": 5,
"line": 95, "line": 95,
"offset": 1585, "offset": 1585,
}, },
"indent": Array [ "indent": [
1, 1,
1, 1,
1, 1,
@ -764,7 +764,7 @@ cmd /C \\"set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy\\"
1, 1,
1, 1,
], ],
"start": Object { "start": {
"column": 1, "column": 1,
"line": 65, "line": 65,
"offset": 1066, "offset": 1066,
@ -802,13 +802,13 @@ cmd /C 'set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy'
</Tabs>", </Tabs>",
}, },
], ],
"position": Object { "position": {
"end": Object { "end": {
"column": 1, "column": 1,
"line": 96, "line": 96,
"offset": 1586, "offset": 1586,
}, },
"start": Object { "start": {
"column": 1, "column": 1,
"line": 1, "line": 1,
"offset": 0, "offset": 0,

View file

@ -1,16 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`migration CLI migrates complex website: copy 1`] = ` exports[`migration CLI migrates complex website: copy 1`] = `
Array [ [
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/blog", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/blog",
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/blog", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/blog",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/pages/en", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/pages/en",
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/src/pages", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/src/pages",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/static", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/static",
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/static", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/static",
], ],
@ -18,18 +18,18 @@ Array [
`; `;
exports[`migration CLI migrates complex website: mkdirp 1`] = ` exports[`migration CLI migrates complex website: mkdirp 1`] = `
Array [ [
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/src/pages", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/src/pages",
], ],
] ]
`; `;
exports[`migration CLI migrates complex website: mkdirs 1`] = `Array []`; exports[`migration CLI migrates complex website: mkdirs 1`] = `[]`;
exports[`migration CLI migrates complex website: write 1`] = ` exports[`migration CLI migrates complex website: write 1`] = `
Array [ [
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/docusaurus.config.js", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/docusaurus.config.js",
"module.exports={ "module.exports={
\\"title\\": \\"Docusaurus\\", \\"title\\": \\"Docusaurus\\",
@ -138,7 +138,7 @@ Array [
} }
}", }",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/package.json", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/package.json",
"{ "{
\\"name\\": \\"docusaurus-1-website\\", \\"name\\": \\"docusaurus-1-website\\",
@ -167,7 +167,7 @@ Array [
} }
}", }",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/src/css/customTheme.css", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/src/css/customTheme.css",
":root{ ":root{
--ifm-color-primary-lightest: #3CAD6E; --ifm-color-primary-lightest: #3CAD6E;
@ -184,16 +184,16 @@ Array [
`; `;
exports[`migration CLI migrates missing versions: copy 1`] = ` exports[`migration CLI migrates missing versions: copy 1`] = `
Array [ [
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/blog", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/blog",
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/blog", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/blog",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/pages/en", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/pages/en",
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/src/pages", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/src/pages",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/static", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/static",
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/static", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/static",
], ],
@ -201,18 +201,18 @@ Array [
`; `;
exports[`migration CLI migrates missing versions: mkdirp 1`] = ` exports[`migration CLI migrates missing versions: mkdirp 1`] = `
Array [ [
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/src/pages", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/src/pages",
], ],
] ]
`; `;
exports[`migration CLI migrates missing versions: mkdirs 1`] = `Array []`; exports[`migration CLI migrates missing versions: mkdirs 1`] = `[]`;
exports[`migration CLI migrates missing versions: write 1`] = ` exports[`migration CLI migrates missing versions: write 1`] = `
Array [ [
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/docusaurus.config.js", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/docusaurus.config.js",
"module.exports={ "module.exports={
\\"title\\": \\"Docusaurus\\", \\"title\\": \\"Docusaurus\\",
@ -321,7 +321,7 @@ Array [
} }
}", }",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/package.json", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/package.json",
"{ "{
\\"name\\": \\"docusaurus-1-website\\", \\"name\\": \\"docusaurus-1-website\\",
@ -350,7 +350,7 @@ Array [
} }
}", }",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/src/css/customTheme.css", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/src/css/customTheme.css",
":root{ ":root{
--ifm-color-primary-lightest: #3CAD6E; --ifm-color-primary-lightest: #3CAD6E;
@ -367,12 +367,12 @@ Array [
`; `;
exports[`migration CLI migrates simple website: copy 1`] = ` exports[`migration CLI migrates simple website: copy 1`] = `
Array [ [
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/pages/en", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/pages/en",
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/src/pages", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/src/pages",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/static", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/static",
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/static", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/static",
], ],
@ -380,18 +380,18 @@ Array [
`; `;
exports[`migration CLI migrates simple website: mkdirp 1`] = ` exports[`migration CLI migrates simple website: mkdirp 1`] = `
Array [ [
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/src/pages", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/src/pages",
], ],
] ]
`; `;
exports[`migration CLI migrates simple website: mkdirs 1`] = `Array []`; exports[`migration CLI migrates simple website: mkdirs 1`] = `[]`;
exports[`migration CLI migrates simple website: write 1`] = ` exports[`migration CLI migrates simple website: write 1`] = `
Array [ [
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/docusaurus.config.js", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/docusaurus.config.js",
"module.exports={ "module.exports={
\\"title\\": \\"Docusaurus\\", \\"title\\": \\"Docusaurus\\",
@ -501,7 +501,7 @@ Array [
} }
}", }",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/package.json", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/package.json",
"{ "{
\\"name\\": \\"docusaurus-1-website\\", \\"name\\": \\"docusaurus-1-website\\",
@ -530,7 +530,7 @@ Array [
} }
}", }",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/src/css/customTheme.css", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/src/css/customTheme.css",
":root{ ":root{
--ifm-color-primary-lightest: #3CAD6E; --ifm-color-primary-lightest: #3CAD6E;
@ -543,7 +543,7 @@ Array [
} }
", ",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/docs/api-commands.md", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/docs/api-commands.md",
"--- "---
id: commands id: commands
@ -552,7 +552,7 @@ title: CLI Commands
## Doc ## Doc
", ",
], ],
Array [ [
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/docs/api-doc-markdown.md", "<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/docs/api-doc-markdown.md",
"--- "---
id: doc-markdown id: doc-markdown

View file

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`toRedirectFilesMetadata creates appropriate metadata for empty baseUrl: fileContent baseUrl=empty 1`] = ` exports[`toRedirectFilesMetadata creates appropriate metadata for empty baseUrl: fileContent baseUrl=empty 1`] = `
Array [ [
"<!DOCTYPE html> "<!DOCTYPE html>
<html> <html>
<head> <head>
@ -17,7 +17,7 @@ Array [
`; `;
exports[`toRedirectFilesMetadata creates appropriate metadata for root baseUrl: fileContent baseUrl=/ 1`] = ` exports[`toRedirectFilesMetadata creates appropriate metadata for root baseUrl: fileContent baseUrl=/ 1`] = `
Array [ [
"<!DOCTYPE html> "<!DOCTYPE html>
<html> <html>
<head> <head>
@ -33,7 +33,7 @@ Array [
`; `;
exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=false: fileContent 1`] = ` exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=false: fileContent 1`] = `
Array [ [
"<!DOCTYPE html> "<!DOCTYPE html>
<html> <html>
<head> <head>
@ -71,7 +71,7 @@ Array [
`; `;
exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=true: fileContent 1`] = ` exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=true: fileContent 1`] = `
Array [ [
"<!DOCTYPE html> "<!DOCTYPE html>
<html> <html>
<head> <head>
@ -109,7 +109,7 @@ Array [
`; `;
exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=undefined: fileContent 1`] = ` exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=undefined: fileContent 1`] = `
Array [ [
"<!DOCTYPE html> "<!DOCTYPE html>
<html> <html>
<head> <head>

View file

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`atom has feed item for each post 1`] = ` exports[`atom has feed item for each post 1`] = `
Array [ [
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?> "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
<feed xmlns=\\"http://www.w3.org/2005/Atom\\"> <feed xmlns=\\"http://www.w3.org/2005/Atom\\">
<id>https://docusaurus.io/myBaseUrl/blog</id> <id>https://docusaurus.io/myBaseUrl/blog</id>
@ -85,7 +85,7 @@ Array [
`; `;
exports[`json has feed item for each post 1`] = ` exports[`json has feed item for each post 1`] = `
Array [ [
"{ "{
\\"version\\": \\"https://jsonfeed.org/version/1\\", \\"version\\": \\"https://jsonfeed.org/version/1\\",
\\"title\\": \\"Hello Blog\\", \\"title\\": \\"Hello Blog\\",
@ -172,7 +172,7 @@ Array [
`; `;
exports[`rss has feed item for each post 1`] = ` exports[`rss has feed item for each post 1`] = `
Array [ [
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?> "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
<rss version=\\"2.0\\" xmlns:dc=\\"http://purl.org/dc/elements/1.1/\\" xmlns:content=\\"http://purl.org/rss/1.0/modules/content/\\"> <rss version=\\"2.0\\" xmlns:dc=\\"http://purl.org/dc/elements/1.1/\\" xmlns:content=\\"http://purl.org/rss/1.0/modules/content/\\">
<channel> <channel>

View file

@ -1,22 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`blog plugin works on blog tags without pagination 1`] = ` exports[`blog plugin works on blog tags without pagination 1`] = `
Object { {
"/blog/tags/tag-1": Object { "/blog/tags/tag-1": {
"items": Array [ "items": [
"/simple/slug/another", "/simple/slug/another",
"/another/tags", "/another/tags",
"/another/tags2", "/another/tags2",
], ],
"name": "tag1", "name": "tag1",
"pages": Array [ "pages": [
Object { {
"items": Array [ "items": [
"/simple/slug/another", "/simple/slug/another",
"/another/tags", "/another/tags",
"/another/tags2", "/another/tags2",
], ],
"metadata": Object { "metadata": {
"blogDescription": "Blog", "blogDescription": "Blog",
"blogTitle": "Blog", "blogTitle": "Blog",
"nextPage": null, "nextPage": null,
@ -31,19 +31,19 @@ Object {
], ],
"permalink": "/blog/tags/tag-1", "permalink": "/blog/tags/tag-1",
}, },
"/blog/tags/tag-2": Object { "/blog/tags/tag-2": {
"items": Array [ "items": [
"/another/tags", "/another/tags",
"/another/tags2", "/another/tags2",
], ],
"name": "tag2", "name": "tag2",
"pages": Array [ "pages": [
Object { {
"items": Array [ "items": [
"/another/tags", "/another/tags",
"/another/tags2", "/another/tags2",
], ],
"metadata": Object { "metadata": {
"blogDescription": "Blog", "blogDescription": "Blog",
"blogTitle": "Blog", "blogTitle": "Blog",
"nextPage": null, "nextPage": null,
@ -62,21 +62,21 @@ Object {
`; `;
exports[`blog plugin works with blog tags 1`] = ` exports[`blog plugin works with blog tags 1`] = `
Object { {
"/blog/tags/tag-1": Object { "/blog/tags/tag-1": {
"items": Array [ "items": [
"/simple/slug/another", "/simple/slug/another",
"/another/tags", "/another/tags",
"/another/tags2", "/another/tags2",
], ],
"name": "tag1", "name": "tag1",
"pages": Array [ "pages": [
Object { {
"items": Array [ "items": [
"/simple/slug/another", "/simple/slug/another",
"/another/tags", "/another/tags",
], ],
"metadata": Object { "metadata": {
"blogDescription": "Blog", "blogDescription": "Blog",
"blogTitle": "Blog", "blogTitle": "Blog",
"nextPage": "/blog/tags/tag-1/page/2", "nextPage": "/blog/tags/tag-1/page/2",
@ -88,11 +88,11 @@ Object {
"totalPages": 2, "totalPages": 2,
}, },
}, },
Object { {
"items": Array [ "items": [
"/another/tags2", "/another/tags2",
], ],
"metadata": Object { "metadata": {
"blogDescription": "Blog", "blogDescription": "Blog",
"blogTitle": "Blog", "blogTitle": "Blog",
"nextPage": null, "nextPage": null,
@ -107,19 +107,19 @@ Object {
], ],
"permalink": "/blog/tags/tag-1", "permalink": "/blog/tags/tag-1",
}, },
"/blog/tags/tag-2": Object { "/blog/tags/tag-2": {
"items": Array [ "items": [
"/another/tags", "/another/tags",
"/another/tags2", "/another/tags2",
], ],
"name": "tag2", "name": "tag2",
"pages": Array [ "pages": [
Object { {
"items": Array [ "items": [
"/another/tags", "/another/tags",
"/another/tags2", "/another/tags2",
], ],
"metadata": Object { "metadata": {
"blogDescription": "Blog", "blogDescription": "Blog",
"blogTitle": "Blog", "blogTitle": "Blog",
"nextPage": null, "nextPage": null,

View file

@ -1,18 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`getContentTranslationFiles returns translation files matching snapshot 1`] = ` exports[`getContentTranslationFiles returns translation files matching snapshot 1`] = `
Array [ [
Object { {
"content": Object { "content": {
"description": Object { "description": {
"description": "The description for the blog used in SEO", "description": "The description for the blog used in SEO",
"message": "Someone's random blog", "message": "Someone's random blog",
}, },
"sidebar.title": Object { "sidebar.title": {
"description": "The label for the left sidebar", "description": "The label for the left sidebar",
"message": "All my posts", "message": "All my posts",
}, },
"title": Object { "title": {
"description": "The title for the blog used in SEO", "description": "The title for the blog used in SEO",
"message": "My blog", "message": "My blog",
}, },
@ -23,13 +23,13 @@ Array [
`; `;
exports[`translateContent falls back when translation is incomplete 1`] = ` exports[`translateContent falls back when translation is incomplete 1`] = `
Object { {
"blogListPaginated": Array [ "blogListPaginated": [
Object { {
"items": Array [ "items": [
"hello", "hello",
], ],
"metadata": Object { "metadata": {
"blogDescription": "Someone's random blog", "blogDescription": "Someone's random blog",
"blogTitle": "My blog", "blogTitle": "My blog",
"nextPage": null, "nextPage": null,
@ -42,35 +42,35 @@ Object {
}, },
}, },
], ],
"blogPosts": Array [ "blogPosts": [
Object { {
"id": "hello", "id": "hello",
"metadata": Object { "metadata": {
"date": 2021-07-19T00:00:00.000Z, "date": 2021-07-19T00:00:00.000Z,
"description": "/blog/2021/06/19/hello", "description": "/blog/2021/06/19/hello",
"formattedDate": "June 19, 2021", "formattedDate": "June 19, 2021",
"permalink": "/blog/2021/06/19/hello", "permalink": "/blog/2021/06/19/hello",
"source": "/blog/2021/06/19/hello", "source": "/blog/2021/06/19/hello",
"tags": Array [], "tags": [],
"title": "Hello", "title": "Hello",
"truncated": true, "truncated": true,
}, },
}, },
], ],
"blogSidebarTitle": "All my posts", "blogSidebarTitle": "All my posts",
"blogTags": Object {}, "blogTags": {},
"blogTagsListPath": "/tags", "blogTagsListPath": "/tags",
} }
`; `;
exports[`translateContent returns translated loaded 1`] = ` exports[`translateContent returns translated loaded 1`] = `
Object { {
"blogListPaginated": Array [ "blogListPaginated": [
Object { {
"items": Array [ "items": [
"hello", "hello",
], ],
"metadata": Object { "metadata": {
"blogDescription": "Someone's random blog (translated)", "blogDescription": "Someone's random blog (translated)",
"blogTitle": "My blog (translated)", "blogTitle": "My blog (translated)",
"nextPage": null, "nextPage": null,
@ -83,23 +83,23 @@ Object {
}, },
}, },
], ],
"blogPosts": Array [ "blogPosts": [
Object { {
"id": "hello", "id": "hello",
"metadata": Object { "metadata": {
"date": 2021-07-19T00:00:00.000Z, "date": 2021-07-19T00:00:00.000Z,
"description": "/blog/2021/06/19/hello", "description": "/blog/2021/06/19/hello",
"formattedDate": "June 19, 2021", "formattedDate": "June 19, 2021",
"permalink": "/blog/2021/06/19/hello", "permalink": "/blog/2021/06/19/hello",
"source": "/blog/2021/06/19/hello", "source": "/blog/2021/06/19/hello",
"tags": Array [], "tags": [],
"title": "Hello", "title": "Hello",
"truncated": true, "truncated": true,
}, },
}, },
], ],
"blogSidebarTitle": "All my posts (translated)", "blogSidebarTitle": "All my posts (translated)",
"blogTags": Object {}, "blogTags": {},
"blogTagsListPath": "/tags", "blogTagsListPath": "/tags",
} }
`; `;

View file

@ -411,11 +411,14 @@ describe('blog plugin', () => {
}); });
it('excludes draft blog post from production build', async () => { it('excludes draft blog post from production build', async () => {
process.env.NODE_ENV = 'production'; const originalEnv = process.env;
jest.resetModules();
process.env = {...originalEnv, NODE_ENV: 'production'};
const siteDir = path.join(__dirname, '__fixtures__', 'website'); const siteDir = path.join(__dirname, '__fixtures__', 'website');
const blogPosts = await getBlogPosts(siteDir); const blogPosts = await getBlogPosts(siteDir);
expect(blogPosts.find((v) => v.metadata.title === 'draft')).toBeUndefined(); expect(blogPosts.find((v) => v.metadata.title === 'draft')).toBeUndefined();
process.env = originalEnv;
}); });
it('creates blog post without date', async () => { it('creates blog post without date', async () => {

View file

@ -1,43 +1,43 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`docsVersion first time versioning 1`] = ` exports[`docsVersion first time versioning 1`] = `
Object { {
"docs": Object { "docs": {
"Guides": Array [ "Guides": [
"hello", "hello",
], ],
"Test": Array [ "Test": [
Object { {
"items": Array [ "items": [
"foo/bar", "foo/bar",
"foo/baz", "foo/baz",
], ],
"label": "foo", "label": "foo",
"type": "category", "type": "category",
}, },
Object { {
"items": Array [ "items": [
"rootAbsoluteSlug", "rootAbsoluteSlug",
"rootRelativeSlug", "rootRelativeSlug",
"rootResolvedSlug", "rootResolvedSlug",
"rootTryToEscapeSlug", "rootTryToEscapeSlug",
], ],
"label": "Slugs", "label": "Slugs",
"link": Object { "link": {
"type": "generated-index", "type": "generated-index",
}, },
"type": "category", "type": "category",
}, },
Object { {
"id": "headingAsTitle", "id": "headingAsTitle",
"type": "doc", "type": "doc",
}, },
Object { {
"href": "https://github.com", "href": "https://github.com",
"label": "Github", "label": "Github",
"type": "link", "type": "link",
}, },
Object { {
"id": "hello", "id": "hello",
"type": "ref", "type": "ref",
}, },
@ -47,12 +47,12 @@ Object {
`; `;
exports[`docsVersion not the first time versioning 1`] = ` exports[`docsVersion not the first time versioning 1`] = `
Object { {
"docs": Object { "docs": {
"Guides": Array [ "Guides": [
"hello", "hello",
], ],
"Test": Array [ "Test": [
"foo/bar", "foo/bar",
], ],
}, },
@ -60,8 +60,8 @@ Object {
`; `;
exports[`docsVersion second docs instance versioning 1`] = ` exports[`docsVersion second docs instance versioning 1`] = `
Object { {
"community": Array [ "community": [
"team", "team",
], ],
} }

View file

@ -1,177 +1,177 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`simple site custom pagination 1`] = ` exports[`simple site custom pagination 1`] = `
Object { {
"pagination": Array [ "pagination": [
Object { {
"id": "doc with space", "id": "doc with space",
"next": Object { "next": {
"permalink": "/docs/foo/bar", "permalink": "/docs/foo/bar",
"title": "Bar", "title": "Bar",
}, },
"prev": undefined, "prev": undefined,
}, },
Object { {
"id": "foo/bar", "id": "foo/bar",
"next": undefined, "next": undefined,
"prev": undefined, "prev": undefined,
}, },
Object { {
"id": "foo/baz", "id": "foo/baz",
"next": Object { "next": {
"permalink": "/docs/headingAsTitle", "permalink": "/docs/headingAsTitle",
"title": "My heading as title", "title": "My heading as title",
}, },
"prev": Object { "prev": {
"permalink": "/docs/foo/bar", "permalink": "/docs/foo/bar",
"title": "Bar", "title": "Bar",
}, },
}, },
Object { {
"id": "headingAsTitle", "id": "headingAsTitle",
"next": Object { "next": {
"permalink": "/docs/", "permalink": "/docs/",
"title": "Hello sidebar_label", "title": "Hello sidebar_label",
}, },
"prev": Object { "prev": {
"permalink": "/docs/foo/bazSlug.html", "permalink": "/docs/foo/bazSlug.html",
"title": "baz pagination_label", "title": "baz pagination_label",
}, },
}, },
Object { {
"id": "hello", "id": "hello",
"next": Object { "next": {
"permalink": "/docs/ipsum", "permalink": "/docs/ipsum",
"title": "ipsum", "title": "ipsum",
}, },
"prev": Object { "prev": {
"permalink": "/docs/headingAsTitle", "permalink": "/docs/headingAsTitle",
"title": "My heading as title", "title": "My heading as title",
}, },
}, },
Object { {
"id": "ipsum", "id": "ipsum",
"next": Object { "next": {
"permalink": "/docs/lorem", "permalink": "/docs/lorem",
"title": "lorem", "title": "lorem",
}, },
"prev": Object { "prev": {
"permalink": "/docs/", "permalink": "/docs/",
"title": "Hello sidebar_label", "title": "Hello sidebar_label",
}, },
}, },
Object { {
"id": "lorem", "id": "lorem",
"next": Object { "next": {
"permalink": "/docs/rootAbsoluteSlug", "permalink": "/docs/rootAbsoluteSlug",
"title": "rootAbsoluteSlug", "title": "rootAbsoluteSlug",
}, },
"prev": Object { "prev": {
"permalink": "/docs/ipsum", "permalink": "/docs/ipsum",
"title": "ipsum", "title": "ipsum",
}, },
}, },
Object { {
"id": "rootAbsoluteSlug", "id": "rootAbsoluteSlug",
"next": Object { "next": {
"permalink": "/docs/headingAsTitle", "permalink": "/docs/headingAsTitle",
"title": "My heading as title", "title": "My heading as title",
}, },
"prev": Object { "prev": {
"permalink": "/docs/foo/bazSlug.html", "permalink": "/docs/foo/bazSlug.html",
"title": "baz pagination_label", "title": "baz pagination_label",
}, },
}, },
Object { {
"id": "rootRelativeSlug", "id": "rootRelativeSlug",
"next": Object { "next": {
"permalink": "/docs/headingAsTitle", "permalink": "/docs/headingAsTitle",
"title": "My heading as title", "title": "My heading as title",
}, },
"prev": Object { "prev": {
"permalink": "/docs/foo/bazSlug.html", "permalink": "/docs/foo/bazSlug.html",
"title": "baz pagination_label", "title": "baz pagination_label",
}, },
}, },
Object { {
"id": "rootResolvedSlug", "id": "rootResolvedSlug",
"next": Object { "next": {
"permalink": "/docs/headingAsTitle", "permalink": "/docs/headingAsTitle",
"title": "My heading as title", "title": "My heading as title",
}, },
"prev": Object { "prev": {
"permalink": "/docs/foo/bazSlug.html", "permalink": "/docs/foo/bazSlug.html",
"title": "baz pagination_label", "title": "baz pagination_label",
}, },
}, },
Object { {
"id": "rootTryToEscapeSlug", "id": "rootTryToEscapeSlug",
"next": Object { "next": {
"permalink": "/docs/headingAsTitle", "permalink": "/docs/headingAsTitle",
"title": "My heading as title", "title": "My heading as title",
}, },
"prev": Object { "prev": {
"permalink": "/docs/foo/bazSlug.html", "permalink": "/docs/foo/bazSlug.html",
"title": "baz pagination_label", "title": "baz pagination_label",
}, },
}, },
Object { {
"id": "slugs/absoluteSlug", "id": "slugs/absoluteSlug",
"next": Object { "next": {
"permalink": "/docs/slugs/relativeSlug", "permalink": "/docs/slugs/relativeSlug",
"title": "relativeSlug", "title": "relativeSlug",
}, },
"prev": Object { "prev": {
"permalink": "/docs/rootTryToEscapeSlug", "permalink": "/docs/rootTryToEscapeSlug",
"title": "rootTryToEscapeSlug", "title": "rootTryToEscapeSlug",
}, },
}, },
Object { {
"id": "slugs/relativeSlug", "id": "slugs/relativeSlug",
"next": Object { "next": {
"permalink": "/docs/slugs/hey/resolvedSlug", "permalink": "/docs/slugs/hey/resolvedSlug",
"title": "resolvedSlug", "title": "resolvedSlug",
}, },
"prev": Object { "prev": {
"permalink": "/docs/absoluteSlug", "permalink": "/docs/absoluteSlug",
"title": "absoluteSlug", "title": "absoluteSlug",
}, },
}, },
Object { {
"id": "slugs/resolvedSlug", "id": "slugs/resolvedSlug",
"next": Object { "next": {
"permalink": "/docs/tryToEscapeSlug", "permalink": "/docs/tryToEscapeSlug",
"title": "tryToEscapeSlug", "title": "tryToEscapeSlug",
}, },
"prev": Object { "prev": {
"permalink": "/docs/slugs/relativeSlug", "permalink": "/docs/slugs/relativeSlug",
"title": "relativeSlug", "title": "relativeSlug",
}, },
}, },
Object { {
"id": "slugs/tryToEscapeSlug", "id": "slugs/tryToEscapeSlug",
"next": undefined, "next": undefined,
"prev": Object { "prev": {
"permalink": "/docs/slugs/hey/resolvedSlug", "permalink": "/docs/slugs/hey/resolvedSlug",
"title": "resolvedSlug", "title": "resolvedSlug",
}, },
}, },
], ],
"sidebars": Object { "sidebars": {
"defaultSidebar": Array [ "defaultSidebar": [
Object { {
"id": "doc with space", "id": "doc with space",
"type": "doc", "type": "doc",
}, },
Object { {
"collapsed": false, "collapsed": false,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "foo/bar", "id": "foo/bar",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "foo/baz", "id": "foo/baz",
"type": "doc", "type": "doc",
}, },
@ -180,56 +180,56 @@ Object {
"link": undefined, "link": undefined,
"type": "category", "type": "category",
}, },
Object { {
"id": "headingAsTitle", "id": "headingAsTitle",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "hello", "id": "hello",
"label": "Hello sidebar_label", "label": "Hello sidebar_label",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "ipsum", "id": "ipsum",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "lorem", "id": "lorem",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "rootAbsoluteSlug", "id": "rootAbsoluteSlug",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "rootRelativeSlug", "id": "rootRelativeSlug",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "rootResolvedSlug", "id": "rootResolvedSlug",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "rootTryToEscapeSlug", "id": "rootTryToEscapeSlug",
"type": "doc", "type": "doc",
}, },
Object { {
"collapsed": false, "collapsed": false,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "slugs/absoluteSlug", "id": "slugs/absoluteSlug",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "slugs/relativeSlug", "id": "slugs/relativeSlug",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "slugs/resolvedSlug", "id": "slugs/resolvedSlug",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "slugs/tryToEscapeSlug", "id": "slugs/tryToEscapeSlug",
"type": "doc", "type": "doc",
}, },

View file

@ -1,19 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`toGlobalDataVersion generates the right docs, sidebars, and metadata 1`] = ` exports[`toGlobalDataVersion generates the right docs, sidebars, and metadata 1`] = `
Object { {
"docs": Array [ "docs": [
Object { {
"id": "main", "id": "main",
"path": "/current/main", "path": "/current/main",
"sidebar": "tutorial", "sidebar": "tutorial",
}, },
Object { {
"id": "doc", "id": "doc",
"path": "/current/doc", "path": "/current/doc",
"sidebar": "tutorial", "sidebar": "tutorial",
}, },
Object { {
"id": "/current/generated", "id": "/current/generated",
"path": "/current/generated", "path": "/current/generated",
"sidebar": "tutorial", "sidebar": "tutorial",
@ -24,16 +24,16 @@ Object {
"mainDocId": "main", "mainDocId": "main",
"name": "current", "name": "current",
"path": "/current", "path": "/current",
"sidebars": Object { "sidebars": {
"another": Object { "another": {
"link": Object { "link": {
"label": "Generated", "label": "Generated",
"path": "/current/generated", "path": "/current/generated",
}, },
}, },
"links": Object {}, "links": {},
"tutorial": Object { "tutorial": {
"link": Object { "link": {
"label": "main", "label": "main",
"path": "/current/main", "path": "/current/main",
}, },

View file

@ -1,76 +1,76 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`getLoadedContentTranslationFiles returns translation files 1`] = ` exports[`getLoadedContentTranslationFiles returns translation files 1`] = `
Array [ [
Object { {
"content": Object { "content": {
"sidebar.docs.category.Getting started": Object { "sidebar.docs.category.Getting started": {
"description": "The label for category Getting started in sidebar docs", "description": "The label for category Getting started in sidebar docs",
"message": "Getting started", "message": "Getting started",
}, },
"sidebar.docs.category.Getting started.link.generated-index.description": Object { "sidebar.docs.category.Getting started.link.generated-index.description": {
"description": "The generated-index page description for category Getting started in sidebar docs", "description": "The generated-index page description for category Getting started in sidebar docs",
"message": "Getting started index description", "message": "Getting started index description",
}, },
"sidebar.docs.category.Getting started.link.generated-index.title": Object { "sidebar.docs.category.Getting started.link.generated-index.title": {
"description": "The generated-index page title for category Getting started in sidebar docs", "description": "The generated-index page title for category Getting started in sidebar docs",
"message": "Getting started index title", "message": "Getting started index title",
}, },
"sidebar.docs.link.Link label": Object { "sidebar.docs.link.Link label": {
"description": "The label for link Link label in sidebar docs, linking to https://facebook.com", "description": "The label for link Link label in sidebar docs, linking to https://facebook.com",
"message": "Link label", "message": "Link label",
}, },
"version.label": Object { "version.label": {
"description": "The label for version current", "description": "The label for version current",
"message": "current label", "message": "current label",
}, },
}, },
"path": "current", "path": "current",
}, },
Object { {
"content": Object { "content": {
"sidebar.docs.category.Getting started": Object { "sidebar.docs.category.Getting started": {
"description": "The label for category Getting started in sidebar docs", "description": "The label for category Getting started in sidebar docs",
"message": "Getting started", "message": "Getting started",
}, },
"sidebar.docs.category.Getting started.link.generated-index.description": Object { "sidebar.docs.category.Getting started.link.generated-index.description": {
"description": "The generated-index page description for category Getting started in sidebar docs", "description": "The generated-index page description for category Getting started in sidebar docs",
"message": "Getting started index description", "message": "Getting started index description",
}, },
"sidebar.docs.category.Getting started.link.generated-index.title": Object { "sidebar.docs.category.Getting started.link.generated-index.title": {
"description": "The generated-index page title for category Getting started in sidebar docs", "description": "The generated-index page title for category Getting started in sidebar docs",
"message": "Getting started index title", "message": "Getting started index title",
}, },
"sidebar.docs.link.Link label": Object { "sidebar.docs.link.Link label": {
"description": "The label for link Link label in sidebar docs, linking to https://facebook.com", "description": "The label for link Link label in sidebar docs, linking to https://facebook.com",
"message": "Link label", "message": "Link label",
}, },
"version.label": Object { "version.label": {
"description": "The label for version 2.0.0", "description": "The label for version 2.0.0",
"message": "2.0.0 label", "message": "2.0.0 label",
}, },
}, },
"path": "version-2.0.0", "path": "version-2.0.0",
}, },
Object { {
"content": Object { "content": {
"sidebar.docs.category.Getting started": Object { "sidebar.docs.category.Getting started": {
"description": "The label for category Getting started in sidebar docs", "description": "The label for category Getting started in sidebar docs",
"message": "Getting started", "message": "Getting started",
}, },
"sidebar.docs.category.Getting started.link.generated-index.description": Object { "sidebar.docs.category.Getting started.link.generated-index.description": {
"description": "The generated-index page description for category Getting started in sidebar docs", "description": "The generated-index page description for category Getting started in sidebar docs",
"message": "Getting started index description", "message": "Getting started index description",
}, },
"sidebar.docs.category.Getting started.link.generated-index.title": Object { "sidebar.docs.category.Getting started.link.generated-index.title": {
"description": "The generated-index page title for category Getting started in sidebar docs", "description": "The generated-index page title for category Getting started in sidebar docs",
"message": "Getting started index title", "message": "Getting started index title",
}, },
"sidebar.docs.link.Link label": Object { "sidebar.docs.link.Link label": {
"description": "The label for link Link label in sidebar docs, linking to https://facebook.com", "description": "The label for link Link label in sidebar docs, linking to https://facebook.com",
"message": "Link label", "message": "Link label",
}, },
"version.label": Object { "version.label": {
"description": "The label for version 1.0.0", "description": "The label for version 1.0.0",
"message": "1.0.0 label", "message": "1.0.0 label",
}, },
@ -81,13 +81,13 @@ Array [
`; `;
exports[`translateLoadedContent returns translated loaded content 1`] = ` exports[`translateLoadedContent returns translated loaded content 1`] = `
Object { {
"loadedVersions": Array [ "loadedVersions": [
Object { {
"contentPath": "any", "contentPath": "any",
"contentPathLocalized": "any", "contentPathLocalized": "any",
"docs": Array [ "docs": [
Object { {
"description": "doc1 description", "description": "doc1 description",
"editUrl": "any", "editUrl": "any",
"id": "doc1", "id": "doc1",
@ -103,7 +103,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc2 description", "description": "doc2 description",
"editUrl": "any", "editUrl": "any",
"id": "doc2", "id": "doc2",
@ -119,7 +119,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc3 description", "description": "doc3 description",
"editUrl": "any", "editUrl": "any",
"id": "doc3", "id": "doc3",
@ -135,7 +135,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc4 description", "description": "doc4 description",
"editUrl": "any", "editUrl": "any",
"id": "doc4", "id": "doc4",
@ -151,7 +151,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc5 description", "description": "doc5 description",
"editUrl": "any", "editUrl": "any",
"id": "doc5", "id": "doc5",
@ -172,31 +172,31 @@ Object {
"mainDocId": "", "mainDocId": "",
"routePriority": undefined, "routePriority": undefined,
"sidebarFilePath": "any", "sidebarFilePath": "any",
"sidebars": Object { "sidebars": {
"docs": Array [ "docs": [
Object { {
"collapsed": false, "collapsed": false,
"items": Array [ "items": [
Object { {
"id": "doc1", "id": "doc1",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc2", "id": "doc2",
"type": "doc", "type": "doc",
}, },
Object { {
"href": "https://facebook.com", "href": "https://facebook.com",
"label": "Link label (translated)", "label": "Link label (translated)",
"type": "link", "type": "link",
}, },
Object { {
"id": "doc1", "id": "doc1",
"type": "ref", "type": "ref",
}, },
], ],
"label": "Getting started (translated)", "label": "Getting started (translated)",
"link": Object { "link": {
"description": "Getting started index description (translated)", "description": "Getting started index description (translated)",
"permalink": "/docs/category/getting-started-index-slug", "permalink": "/docs/category/getting-started-index-slug",
"slug": "/category/getting-started-index-slug", "slug": "/category/getting-started-index-slug",
@ -205,17 +205,17 @@ Object {
}, },
"type": "category", "type": "category",
}, },
Object { {
"id": "doc3", "id": "doc3",
"type": "doc", "type": "doc",
}, },
], ],
"otherSidebar": Array [ "otherSidebar": [
Object { {
"id": "doc4", "id": "doc4",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc5", "id": "doc5",
"type": "doc", "type": "doc",
}, },
@ -225,11 +225,11 @@ Object {
"versionName": "current", "versionName": "current",
"versionPath": "/docs/", "versionPath": "/docs/",
}, },
Object { {
"contentPath": "any", "contentPath": "any",
"contentPathLocalized": "any", "contentPathLocalized": "any",
"docs": Array [ "docs": [
Object { {
"description": "doc1 description", "description": "doc1 description",
"editUrl": "any", "editUrl": "any",
"id": "doc1", "id": "doc1",
@ -245,7 +245,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc2 description", "description": "doc2 description",
"editUrl": "any", "editUrl": "any",
"id": "doc2", "id": "doc2",
@ -261,7 +261,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc3 description", "description": "doc3 description",
"editUrl": "any", "editUrl": "any",
"id": "doc3", "id": "doc3",
@ -277,7 +277,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc4 description", "description": "doc4 description",
"editUrl": "any", "editUrl": "any",
"id": "doc4", "id": "doc4",
@ -293,7 +293,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc5 description", "description": "doc5 description",
"editUrl": "any", "editUrl": "any",
"id": "doc5", "id": "doc5",
@ -314,31 +314,31 @@ Object {
"mainDocId": "", "mainDocId": "",
"routePriority": undefined, "routePriority": undefined,
"sidebarFilePath": "any", "sidebarFilePath": "any",
"sidebars": Object { "sidebars": {
"docs": Array [ "docs": [
Object { {
"collapsed": false, "collapsed": false,
"items": Array [ "items": [
Object { {
"id": "doc1", "id": "doc1",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc2", "id": "doc2",
"type": "doc", "type": "doc",
}, },
Object { {
"href": "https://facebook.com", "href": "https://facebook.com",
"label": "Link label (translated)", "label": "Link label (translated)",
"type": "link", "type": "link",
}, },
Object { {
"id": "doc1", "id": "doc1",
"type": "ref", "type": "ref",
}, },
], ],
"label": "Getting started (translated)", "label": "Getting started (translated)",
"link": Object { "link": {
"description": "Getting started index description (translated)", "description": "Getting started index description (translated)",
"permalink": "/docs/category/getting-started-index-slug", "permalink": "/docs/category/getting-started-index-slug",
"slug": "/category/getting-started-index-slug", "slug": "/category/getting-started-index-slug",
@ -347,17 +347,17 @@ Object {
}, },
"type": "category", "type": "category",
}, },
Object { {
"id": "doc3", "id": "doc3",
"type": "doc", "type": "doc",
}, },
], ],
"otherSidebar": Array [ "otherSidebar": [
Object { {
"id": "doc4", "id": "doc4",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc5", "id": "doc5",
"type": "doc", "type": "doc",
}, },
@ -367,11 +367,11 @@ Object {
"versionName": "2.0.0", "versionName": "2.0.0",
"versionPath": "/docs/", "versionPath": "/docs/",
}, },
Object { {
"contentPath": "any", "contentPath": "any",
"contentPathLocalized": "any", "contentPathLocalized": "any",
"docs": Array [ "docs": [
Object { {
"description": "doc1 description", "description": "doc1 description",
"editUrl": "any", "editUrl": "any",
"id": "doc1", "id": "doc1",
@ -387,7 +387,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc2 description", "description": "doc2 description",
"editUrl": "any", "editUrl": "any",
"id": "doc2", "id": "doc2",
@ -403,7 +403,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc3 description", "description": "doc3 description",
"editUrl": "any", "editUrl": "any",
"id": "doc3", "id": "doc3",
@ -419,7 +419,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc4 description", "description": "doc4 description",
"editUrl": "any", "editUrl": "any",
"id": "doc4", "id": "doc4",
@ -435,7 +435,7 @@ Object {
"unversionedId": "any", "unversionedId": "any",
"version": "any", "version": "any",
}, },
Object { {
"description": "doc5 description", "description": "doc5 description",
"editUrl": "any", "editUrl": "any",
"id": "doc5", "id": "doc5",
@ -456,31 +456,31 @@ Object {
"mainDocId": "", "mainDocId": "",
"routePriority": undefined, "routePriority": undefined,
"sidebarFilePath": "any", "sidebarFilePath": "any",
"sidebars": Object { "sidebars": {
"docs": Array [ "docs": [
Object { {
"collapsed": false, "collapsed": false,
"items": Array [ "items": [
Object { {
"id": "doc1", "id": "doc1",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc2", "id": "doc2",
"type": "doc", "type": "doc",
}, },
Object { {
"href": "https://facebook.com", "href": "https://facebook.com",
"label": "Link label (translated)", "label": "Link label (translated)",
"type": "link", "type": "link",
}, },
Object { {
"id": "doc1", "id": "doc1",
"type": "ref", "type": "ref",
}, },
], ],
"label": "Getting started (translated)", "label": "Getting started (translated)",
"link": Object { "link": {
"description": "Getting started index description (translated)", "description": "Getting started index description (translated)",
"permalink": "/docs/category/getting-started-index-slug", "permalink": "/docs/category/getting-started-index-slug",
"slug": "/category/getting-started-index-slug", "slug": "/category/getting-started-index-slug",
@ -489,17 +489,17 @@ Object {
}, },
"type": "category", "type": "category",
}, },
Object { {
"id": "doc3", "id": "doc3",
"type": "doc", "type": "doc",
}, },
], ],
"otherSidebar": Array [ "otherSidebar": [
Object { {
"id": "doc4", "id": "doc4",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc5", "id": "doc5",
"type": "doc", "type": "doc",
}, },

View file

@ -1,54 +1,54 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DefaultSidebarItemsGenerator generates complex nested sidebar 1`] = ` exports[`DefaultSidebarItemsGenerator generates complex nested sidebar 1`] = `
Array [ [
Object { {
"id": "intro", "id": "intro",
"type": "doc", "type": "doc",
}, },
Object { {
"collapsed": undefined, "collapsed": undefined,
"collapsible": undefined, "collapsible": undefined,
"items": Array [ "items": [
Object { {
"id": "tutorial1", "id": "tutorial1",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "tutorial2", "id": "tutorial2",
"type": "doc", "type": "doc",
}, },
], ],
"label": "Tutorials", "label": "Tutorials",
"link": Object { "link": {
"id": "tutorials-index", "id": "tutorials-index",
"type": "doc", "type": "doc",
}, },
"type": "category", "type": "category",
}, },
Object { {
"collapsed": false, "collapsed": false,
"collapsible": undefined, "collapsible": undefined,
"customProps": Object { "customProps": {
"description": "foo", "description": "foo",
}, },
"items": Array [ "items": [
Object { {
"className": "foo", "className": "foo",
"id": "guide1", "id": "guide1",
"type": "doc", "type": "doc",
}, },
Object { {
"collapsed": undefined, "collapsed": undefined,
"collapsible": undefined, "collapsible": undefined,
"items": Array [ "items": [
Object { {
"id": "nested-guide", "id": "nested-guide",
"type": "doc", "type": "doc",
}, },
], ],
"label": "SubGuides (metadata file label)", "label": "SubGuides (metadata file label)",
"link": Object { "link": {
"description": "subGuides-description", "description": "subGuides-description",
"slug": "subGuides-generated-index-slug", "slug": "subGuides-generated-index-slug",
"title": "subGuides-title", "title": "subGuides-title",
@ -56,19 +56,19 @@ Array [
}, },
"type": "category", "type": "category",
}, },
Object { {
"id": "guide2", "id": "guide2",
"type": "doc", "type": "doc",
}, },
], ],
"label": "Guides", "label": "Guides",
"link": Object { "link": {
"id": "guides-index", "id": "guides-index",
"type": "doc", "type": "doc",
}, },
"type": "category", "type": "category",
}, },
Object { {
"id": "end", "id": "end",
"type": "doc", "type": "doc",
}, },
@ -76,25 +76,25 @@ Array [
`; `;
exports[`DefaultSidebarItemsGenerator generates simple flat sidebar 1`] = ` exports[`DefaultSidebarItemsGenerator generates simple flat sidebar 1`] = `
Array [ [
Object { {
"id": "doc3", "id": "doc3",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc4", "id": "doc4",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc1", "id": "doc1",
"label": "doc1 sidebar label", "label": "doc1 sidebar label",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc2", "id": "doc2",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc5", "id": "doc5",
"type": "doc", "type": "doc",
}, },
@ -102,33 +102,33 @@ Array [
`; `;
exports[`DefaultSidebarItemsGenerator generates subfolder sidebar 1`] = ` exports[`DefaultSidebarItemsGenerator generates subfolder sidebar 1`] = `
Array [ [
Object { {
"collapsed": undefined, "collapsed": undefined,
"collapsible": undefined, "collapsible": undefined,
"items": Array [ "items": [
Object { {
"id": "doc8", "id": "doc8",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc7", "id": "doc7",
"type": "doc", "type": "doc",
}, },
], ],
"label": "subsubsubfolder3 (_category_.json label)", "label": "subsubsubfolder3 (_category_.json label)",
"link": Object { "link": {
"id": "doc1", "id": "doc1",
"type": "doc", "type": "doc",
}, },
"type": "category", "type": "category",
}, },
Object { {
"className": "bar", "className": "bar",
"collapsed": undefined, "collapsed": undefined,
"collapsible": undefined, "collapsible": undefined,
"items": Array [ "items": [
Object { {
"id": "doc6", "id": "doc6",
"type": "doc", "type": "doc",
}, },
@ -136,19 +136,19 @@ Array [
"label": "subsubsubfolder2 (_category_.yml label)", "label": "subsubsubfolder2 (_category_.yml label)",
"type": "category", "type": "category",
}, },
Object { {
"id": "doc1", "id": "doc1",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc4", "id": "doc4",
"type": "doc", "type": "doc",
}, },
Object { {
"collapsed": undefined, "collapsed": undefined,
"collapsible": undefined, "collapsible": undefined,
"items": Array [ "items": [
Object { {
"id": "doc5", "id": "doc5",
"type": "doc", "type": "doc",
}, },
@ -160,45 +160,45 @@ Array [
`; `;
exports[`DefaultSidebarItemsGenerator respects custom isCategoryIndex 1`] = ` exports[`DefaultSidebarItemsGenerator respects custom isCategoryIndex 1`] = `
Array [ [
Object { {
"id": "intro", "id": "intro",
"type": "doc", "type": "doc",
}, },
Object { {
"collapsed": undefined, "collapsed": undefined,
"collapsible": undefined, "collapsible": undefined,
"items": Array [ "items": [
Object { {
"id": "tutorial1", "id": "tutorial1",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "tutorial2", "id": "tutorial2",
"type": "doc", "type": "doc",
}, },
], ],
"label": "Tutorials", "label": "Tutorials",
"link": Object { "link": {
"id": "tutorials-index", "id": "tutorials-index",
"type": "doc", "type": "doc",
}, },
"type": "category", "type": "category",
}, },
Object { {
"collapsed": undefined, "collapsed": undefined,
"collapsible": undefined, "collapsible": undefined,
"items": Array [ "items": [
Object { {
"className": "foo", "className": "foo",
"id": "guide1", "id": "guide1",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "guide2", "id": "guide2",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "not-guides-index", "id": "not-guides-index",
"type": "doc", "type": "doc",
}, },
@ -210,40 +210,40 @@ Array [
`; `;
exports[`DefaultSidebarItemsGenerator uses explicit link over the index/readme.{md,mdx} naming convention 1`] = ` exports[`DefaultSidebarItemsGenerator uses explicit link over the index/readme.{md,mdx} naming convention 1`] = `
Array [ [
Object { {
"collapsed": undefined, "collapsed": undefined,
"collapsible": undefined, "collapsible": undefined,
"items": Array [ "items": [
Object { {
"id": "parent/doc2", "id": "parent/doc2",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "parent/doc1", "id": "parent/doc1",
"type": "doc", "type": "doc",
}, },
], ],
"label": "Category label", "label": "Category label",
"link": Object { "link": {
"id": "parent/doc3", "id": "parent/doc3",
"type": "doc", "type": "doc",
}, },
"type": "category", "type": "category",
}, },
Object { {
"collapsed": undefined, "collapsed": undefined,
"collapsible": undefined, "collapsible": undefined,
"items": Array [ "items": [
Object { {
"id": "parent/doc4", "id": "parent/doc4",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "parent/doc6", "id": "parent/doc6",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "parent/doc5", "id": "parent/doc5",
"type": "doc", "type": "doc",
}, },

View file

@ -1,13 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`loadSidebars sidebars link 1`] = ` exports[`loadSidebars sidebars link 1`] = `
Object { {
"docs": Array [ "docs": [
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"href": "https://github.com", "href": "https://github.com",
"label": "category", "label": "category",
"type": "link", "type": "link",
@ -22,17 +22,17 @@ Object {
`; `;
exports[`loadSidebars sidebars with category.collapsed property 1`] = ` exports[`loadSidebars sidebars with category.collapsed property 1`] = `
Object { {
"docs": Array [ "docs": [
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"collapsed": false, "collapsed": false,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "doc1", "id": "doc1",
"type": "doc", "type": "doc",
}, },
@ -46,15 +46,15 @@ Object {
"link": undefined, "link": undefined,
"type": "category", "type": "category",
}, },
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"collapsed": false, "collapsed": false,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "doc2", "id": "doc2",
"type": "doc", "type": "doc",
}, },
@ -73,13 +73,13 @@ Object {
`; `;
exports[`loadSidebars sidebars with category.collapsed property at first level 1`] = ` exports[`loadSidebars sidebars with category.collapsed property at first level 1`] = `
Object { {
"docs": Array [ "docs": [
Object { {
"collapsed": false, "collapsed": false,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "doc1", "id": "doc1",
"type": "doc", "type": "doc",
}, },
@ -88,11 +88,11 @@ Object {
"link": undefined, "link": undefined,
"type": "category", "type": "category",
}, },
Object { {
"collapsed": false, "collapsed": false,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "doc2", "id": "doc2",
"type": "doc", "type": "doc",
}, },
@ -106,41 +106,41 @@ Object {
`; `;
exports[`loadSidebars sidebars with deep level of category 1`] = ` exports[`loadSidebars sidebars with deep level of category 1`] = `
Object { {
"docs": Array [ "docs": [
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "a", "id": "a",
"type": "doc", "type": "doc",
}, },
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "c", "id": "c",
"type": "doc", "type": "doc",
}, },
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "d", "id": "d",
"type": "doc", "type": "doc",
}, },
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "e", "id": "e",
"type": "doc", "type": "doc",
}, },
@ -159,7 +159,7 @@ Object {
"link": undefined, "link": undefined,
"type": "category", "type": "category",
}, },
Object { {
"id": "f", "id": "f",
"type": "doc", "type": "doc",
}, },
@ -178,13 +178,13 @@ Object {
`; `;
exports[`loadSidebars sidebars with first level not a category 1`] = ` exports[`loadSidebars sidebars with first level not a category 1`] = `
Object { {
"docs": Array [ "docs": [
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "greeting", "id": "greeting",
"type": "doc", "type": "doc",
}, },
@ -193,7 +193,7 @@ Object {
"link": undefined, "link": undefined,
"type": "category", "type": "category",
}, },
Object { {
"id": "api", "id": "api",
"type": "doc", "type": "doc",
}, },
@ -202,26 +202,26 @@ Object {
`; `;
exports[`loadSidebars sidebars with known sidebar item type 1`] = ` exports[`loadSidebars sidebars with known sidebar item type 1`] = `
Object { {
"docs": Array [ "docs": [
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "foo/bar", "id": "foo/bar",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "foo/baz", "id": "foo/baz",
"type": "doc", "type": "doc",
}, },
Object { {
"href": "https://github.com", "href": "https://github.com",
"label": "Github", "label": "Github",
"type": "link", "type": "link",
}, },
Object { {
"id": "hello", "id": "hello",
"type": "ref", "type": "ref",
}, },
@ -230,11 +230,11 @@ Object {
"link": undefined, "link": undefined,
"type": "category", "type": "category",
}, },
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "hello", "id": "hello",
"type": "doc", "type": "doc",
}, },
@ -248,13 +248,13 @@ Object {
`; `;
exports[`loadSidebars undefined path 1`] = ` exports[`loadSidebars undefined path 1`] = `
Object { {
"defaultSidebar": Array [ "defaultSidebar": [
Object { {
"collapsed": true, "collapsed": true,
"collapsible": true, "collapsible": true,
"items": Array [ "items": [
Object { {
"id": "bar", "id": "bar",
"type": "doc", "type": "doc",
}, },

View file

@ -1,15 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`normalization normalizes shorthands 1`] = ` exports[`normalization normalizes shorthands 1`] = `
Object { {
"sidebar": Array [ "sidebar": [
Object { {
"items": Array [ "items": [
Object { {
"id": "doc1", "id": "doc1",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc2", "id": "doc2",
"type": "doc", "type": "doc",
}, },
@ -17,15 +17,15 @@ Object {
"label": "Category", "label": "Category",
"type": "category", "type": "category",
}, },
Object { {
"items": Array [ "items": [
Object { {
"items": Array [ "items": [
Object { {
"id": "doc3", "id": "doc3",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc4", "id": "doc4",
"type": "doc", "type": "doc",
}, },
@ -33,13 +33,13 @@ Object {
"label": "Subcategory 1", "label": "Subcategory 1",
"type": "category", "type": "category",
}, },
Object { {
"items": Array [ "items": [
Object { {
"id": "doc5", "id": "doc5",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc6", "id": "doc6",
"type": "doc", "type": "doc",
}, },
@ -56,20 +56,20 @@ Object {
`; `;
exports[`normalization normalizes shorthands 2`] = ` exports[`normalization normalizes shorthands 2`] = `
Object { {
"sidebar": Array [ "sidebar": [
Object { {
"href": "https://google.com", "href": "https://google.com",
"label": "Google", "label": "Google",
"type": "link", "type": "link",
}, },
Object { {
"items": Array [ "items": [
Object { {
"id": "doc1", "id": "doc1",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc2", "id": "doc2",
"type": "doc", "type": "doc",
}, },
@ -77,13 +77,13 @@ Object {
"label": "Category 1", "label": "Category 1",
"type": "category", "type": "category",
}, },
Object { {
"items": Array [ "items": [
Object { {
"id": "doc3", "id": "doc3",
"type": "doc", "type": "doc",
}, },
Object { {
"id": "doc4", "id": "doc4",
"type": "doc", "type": "doc",
}, },

View file

@ -1,13 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`postProcess corrects collapsed state inconsistencies 1`] = ` exports[`postProcess corrects collapsed state inconsistencies 1`] = `
Object { {
"sidebar": Array [ "sidebar": [
Object { {
"collapsed": false, "collapsed": false,
"collapsible": false, "collapsible": false,
"items": Array [ "items": [
Object { {
"id": "foo", "id": "foo",
"type": "doc", "type": "doc",
}, },
@ -21,13 +21,13 @@ Object {
`; `;
exports[`postProcess corrects collapsed state inconsistencies 2`] = ` exports[`postProcess corrects collapsed state inconsistencies 2`] = `
Object { {
"sidebar": Array [ "sidebar": [
Object { {
"collapsed": false, "collapsed": false,
"collapsible": false, "collapsible": false,
"items": Array [ "items": [
Object { {
"id": "foo", "id": "foo",
"type": "doc", "type": "doc",
}, },
@ -41,13 +41,13 @@ Object {
`; `;
exports[`postProcess corrects collapsed state inconsistencies 3`] = ` exports[`postProcess corrects collapsed state inconsistencies 3`] = `
Object { {
"sidebar": Array [ "sidebar": [
Object { {
"collapsed": false, "collapsed": false,
"collapsible": false, "collapsible": false,
"items": Array [ "items": [
Object { {
"id": "foo", "id": "foo",
"type": "doc", "type": "doc",
}, },
@ -61,14 +61,14 @@ Object {
`; `;
exports[`postProcess transforms category without subitems 1`] = ` exports[`postProcess transforms category without subitems 1`] = `
Object { {
"sidebar": Array [ "sidebar": [
Object { {
"href": "version/generated/permalink", "href": "version/generated/permalink",
"label": "Category", "label": "Category",
"type": "link", "type": "link",
}, },
Object { {
"id": "doc ID", "id": "doc ID",
"label": "Category 2", "label": "Category 2",
"type": "doc", "type": "doc",

View file

@ -1,28 +1,28 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`docusaurus-plugin-content-pages loads simple pages 1`] = ` exports[`docusaurus-plugin-content-pages loads simple pages 1`] = `
Array [ [
Object { {
"permalink": "/", "permalink": "/",
"source": "@site/src/pages/index.js", "source": "@site/src/pages/index.js",
"type": "jsx", "type": "jsx",
}, },
Object { {
"permalink": "/typescript", "permalink": "/typescript",
"source": "@site/src/pages/typescript.tsx", "source": "@site/src/pages/typescript.tsx",
"type": "jsx", "type": "jsx",
}, },
Object { {
"description": "Markdown index page", "description": "Markdown index page",
"frontMatter": Object {}, "frontMatter": {},
"permalink": "/hello/", "permalink": "/hello/",
"source": "@site/src/pages/hello/index.md", "source": "@site/src/pages/hello/index.md",
"title": "Index", "title": "Index",
"type": "mdx", "type": "mdx",
}, },
Object { {
"description": "my mdx page", "description": "my mdx page",
"frontMatter": Object { "frontMatter": {
"description": "my mdx page", "description": "my mdx page",
"title": "mdx page", "title": "mdx page",
}, },
@ -31,20 +31,20 @@ Array [
"title": "mdx page", "title": "mdx page",
"type": "mdx", "type": "mdx",
}, },
Object { {
"permalink": "/hello/translatedJs", "permalink": "/hello/translatedJs",
"source": "@site/src/pages/hello/translatedJs.js", "source": "@site/src/pages/hello/translatedJs.js",
"type": "jsx", "type": "jsx",
}, },
Object { {
"description": "translated markdown page", "description": "translated markdown page",
"frontMatter": Object {}, "frontMatter": {},
"permalink": "/hello/translatedMd", "permalink": "/hello/translatedMd",
"source": "@site/src/pages/hello/translatedMd.md", "source": "@site/src/pages/hello/translatedMd.md",
"title": undefined, "title": undefined,
"type": "mdx", "type": "mdx",
}, },
Object { {
"permalink": "/hello/world", "permalink": "/hello/world",
"source": "@site/src/pages/hello/world.js", "source": "@site/src/pages/hello/world.js",
"type": "jsx", "type": "jsx",
@ -53,28 +53,28 @@ Array [
`; `;
exports[`docusaurus-plugin-content-pages loads simple pages with french translations 1`] = ` exports[`docusaurus-plugin-content-pages loads simple pages with french translations 1`] = `
Array [ [
Object { {
"permalink": "/", "permalink": "/",
"source": "@site/src/pages/index.js", "source": "@site/src/pages/index.js",
"type": "jsx", "type": "jsx",
}, },
Object { {
"permalink": "/typescript", "permalink": "/typescript",
"source": "@site/src/pages/typescript.tsx", "source": "@site/src/pages/typescript.tsx",
"type": "jsx", "type": "jsx",
}, },
Object { {
"description": "Markdown index page", "description": "Markdown index page",
"frontMatter": Object {}, "frontMatter": {},
"permalink": "/hello/", "permalink": "/hello/",
"source": "@site/src/pages/hello/index.md", "source": "@site/src/pages/hello/index.md",
"title": "Index", "title": "Index",
"type": "mdx", "type": "mdx",
}, },
Object { {
"description": "my mdx page", "description": "my mdx page",
"frontMatter": Object { "frontMatter": {
"description": "my mdx page", "description": "my mdx page",
"title": "mdx page", "title": "mdx page",
}, },
@ -83,20 +83,20 @@ Array [
"title": "mdx page", "title": "mdx page",
"type": "mdx", "type": "mdx",
}, },
Object { {
"permalink": "/hello/translatedJs", "permalink": "/hello/translatedJs",
"source": "@site/i18n/fr/docusaurus-plugin-content-pages/hello/translatedJs.js", "source": "@site/i18n/fr/docusaurus-plugin-content-pages/hello/translatedJs.js",
"type": "jsx", "type": "jsx",
}, },
Object { {
"description": "translated markdown page (fr)", "description": "translated markdown page (fr)",
"frontMatter": Object {}, "frontMatter": {},
"permalink": "/hello/translatedMd", "permalink": "/hello/translatedMd",
"source": "@site/i18n/fr/docusaurus-plugin-content-pages/hello/translatedMd.md", "source": "@site/i18n/fr/docusaurus-plugin-content-pages/hello/translatedMd.md",
"title": undefined, "title": undefined,
"type": "mdx", "type": "mdx",
}, },
Object { {
"permalink": "/hello/world", "permalink": "/hello/world",
"source": "@site/src/pages/hello/world.js", "source": "@site/src/pages/hello/world.js",
"type": "jsx", "type": "jsx",

View file

@ -1,51 +1,51 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`getTranslationFiles returns translation files matching snapshot 1`] = ` exports[`getTranslationFiles returns translation files matching snapshot 1`] = `
Array [ [
Object { {
"content": Object { "content": {
"item.label.Dropdown": Object { "item.label.Dropdown": {
"description": "Navbar item with label Dropdown", "description": "Navbar item with label Dropdown",
"message": "Dropdown", "message": "Dropdown",
}, },
"item.label.Dropdown item 1": Object { "item.label.Dropdown item 1": {
"description": "Navbar item with label Dropdown item 1", "description": "Navbar item with label Dropdown item 1",
"message": "Dropdown item 1", "message": "Dropdown item 1",
}, },
"item.label.Dropdown item 2": Object { "item.label.Dropdown item 2": {
"description": "Navbar item with label Dropdown item 2", "description": "Navbar item with label Dropdown item 2",
"message": "Dropdown item 2", "message": "Dropdown item 2",
}, },
"title": Object { "title": {
"description": "The title in the navbar", "description": "The title in the navbar",
"message": "navbar title", "message": "navbar title",
}, },
}, },
"path": "navbar", "path": "navbar",
}, },
Object { {
"content": Object { "content": {
"copyright": Object { "copyright": {
"description": "The footer copyright", "description": "The footer copyright",
"message": "Copyright FB", "message": "Copyright FB",
}, },
"link.item.label.Link 1": Object { "link.item.label.Link 1": {
"description": "The label of footer link with label=Link 1 linking to https://facebook.com", "description": "The label of footer link with label=Link 1 linking to https://facebook.com",
"message": "Link 1", "message": "Link 1",
}, },
"link.item.label.Link 2": Object { "link.item.label.Link 2": {
"description": "The label of footer link with label=Link 2 linking to https://facebook.com", "description": "The label of footer link with label=Link 2 linking to https://facebook.com",
"message": "Link 2", "message": "Link 2",
}, },
"link.item.label.Link 3": Object { "link.item.label.Link 3": {
"description": "The label of footer link with label=Link 3 linking to https://facebook.com", "description": "The label of footer link with label=Link 3 linking to https://facebook.com",
"message": "Link 3", "message": "Link 3",
}, },
"link.title.Footer link column 1": Object { "link.title.Footer link column 1": {
"description": "The title of the footer links column with title=Footer link column 1 in the footer", "description": "The title of the footer links column with title=Footer link column 1 in the footer",
"message": "Footer link column 1", "message": "Footer link column 1",
}, },
"link.title.Footer link column 2": Object { "link.title.Footer link column 2": {
"description": "The title of the footer links column with title=Footer link column 2 in the footer", "description": "The title of the footer links column with title=Footer link column 2 in the footer",
"message": "Footer link column 2", "message": "Footer link column 2",
}, },
@ -56,39 +56,39 @@ Array [
`; `;
exports[`getTranslationFiles returns translation files matching snapshot 2`] = ` exports[`getTranslationFiles returns translation files matching snapshot 2`] = `
Array [ [
Object { {
"content": Object { "content": {
"item.label.Dropdown": Object { "item.label.Dropdown": {
"description": "Navbar item with label Dropdown", "description": "Navbar item with label Dropdown",
"message": "Dropdown", "message": "Dropdown",
}, },
"item.label.Dropdown item 1": Object { "item.label.Dropdown item 1": {
"description": "Navbar item with label Dropdown item 1", "description": "Navbar item with label Dropdown item 1",
"message": "Dropdown item 1", "message": "Dropdown item 1",
}, },
"item.label.Dropdown item 2": Object { "item.label.Dropdown item 2": {
"description": "Navbar item with label Dropdown item 2", "description": "Navbar item with label Dropdown item 2",
"message": "Dropdown item 2", "message": "Dropdown item 2",
}, },
"title": Object { "title": {
"description": "The title in the navbar", "description": "The title in the navbar",
"message": "navbar title", "message": "navbar title",
}, },
}, },
"path": "navbar", "path": "navbar",
}, },
Object { {
"content": Object { "content": {
"copyright": Object { "copyright": {
"description": "The footer copyright", "description": "The footer copyright",
"message": "Copyright FB", "message": "Copyright FB",
}, },
"link.item.label.Link 1": Object { "link.item.label.Link 1": {
"description": "The label of footer link with label=Link 1 linking to https://facebook.com", "description": "The label of footer link with label=Link 1 linking to https://facebook.com",
"message": "Link 1", "message": "Link 1",
}, },
"link.item.label.Link 2": Object { "link.item.label.Link 2": {
"description": "The label of footer link with label=Link 2 linking to https://facebook.com", "description": "The label of footer link with label=Link 2 linking to https://facebook.com",
"message": "Link 2", "message": "Link 2",
}, },
@ -99,31 +99,31 @@ Array [
`; `;
exports[`translateThemeConfig returns translated themeConfig 1`] = ` exports[`translateThemeConfig returns translated themeConfig 1`] = `
Object { {
"announcementBar": Object {}, "announcementBar": {},
"colorMode": Object {}, "colorMode": {},
"docs": Object { "docs": {
"versionPersistence": "none", "versionPersistence": "none",
}, },
"footer": Object { "footer": {
"copyright": "Copyright FB (translated)", "copyright": "Copyright FB (translated)",
"links": Array [ "links": [
Object { {
"items": Array [ "items": [
Object { {
"label": "Link 1 (translated)", "label": "Link 1 (translated)",
"to": "https://facebook.com", "to": "https://facebook.com",
}, },
Object { {
"label": "Link 2 (translated)", "label": "Link 2 (translated)",
"to": "https://facebook.com", "to": "https://facebook.com",
}, },
], ],
"title": "Footer link column 1 (translated)", "title": "Footer link column 1 (translated)",
}, },
Object { {
"items": Array [ "items": [
Object { {
"label": "Link 3 (translated)", "label": "Link 3 (translated)",
"to": "https://facebook.com", "to": "https://facebook.com",
}, },
@ -134,17 +134,17 @@ Object {
"style": "light", "style": "light",
}, },
"hideableSidebar": true, "hideableSidebar": true,
"navbar": Object { "navbar": {
"hideOnScroll": false, "hideOnScroll": false,
"items": Array [ "items": [
Object { {
"items": Array [ "items": [
Object { {
"items": Array [], "items": [],
"label": "Dropdown item 1 (translated)", "label": "Dropdown item 1 (translated)",
}, },
Object { {
"items": Array [], "items": [],
"label": "Dropdown item 2 (translated)", "label": "Dropdown item 2 (translated)",
}, },
], ],
@ -154,6 +154,6 @@ Object {
"style": "dark", "style": "dark",
"title": "navbar title (translated)", "title": "navbar title (translated)",
}, },
"prism": Object {}, "prism": {},
} }
`; `;

View file

@ -1,71 +1,71 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`parseLines does not parse content with metastring 1`] = ` exports[`parseLines does not parse content with metastring 1`] = `
Object { {
"code": "aaaaa "code": "aaaaa
nnnnn", nnnnn",
"highlightLines": Array [ "highlightLines": [
0, 0,
], ],
} }
`; `;
exports[`parseLines does not parse content with metastring 2`] = ` exports[`parseLines does not parse content with metastring 2`] = `
Object { {
"code": "// highlight-next-line "code": "// highlight-next-line
aaaaa aaaaa
bbbbb", bbbbb",
"highlightLines": Array [ "highlightLines": [
0, 0,
], ],
} }
`; `;
exports[`parseLines does not parse content with metastring 3`] = ` exports[`parseLines does not parse content with metastring 3`] = `
Object { {
"code": "aaaaa "code": "aaaaa
bbbbb", bbbbb",
"highlightLines": Array [ "highlightLines": [
0, 0,
], ],
} }
`; `;
exports[`parseLines does not parse content with no language 1`] = ` exports[`parseLines does not parse content with no language 1`] = `
Object { {
"code": "// highlight-next-line "code": "// highlight-next-line
aaaaa aaaaa
bbbbb", bbbbb",
"highlightLines": Array [], "highlightLines": [],
} }
`; `;
exports[`parseLines removes lines correctly 1`] = ` exports[`parseLines removes lines correctly 1`] = `
Object { {
"code": "aaaaa "code": "aaaaa
bbbbb", bbbbb",
"highlightLines": Array [ "highlightLines": [
0, 0,
], ],
} }
`; `;
exports[`parseLines removes lines correctly 2`] = ` exports[`parseLines removes lines correctly 2`] = `
Object { {
"code": "aaaaa "code": "aaaaa
bbbbb", bbbbb",
"highlightLines": Array [ "highlightLines": [
0, 0,
], ],
} }
`; `;
exports[`parseLines removes lines correctly 3`] = ` exports[`parseLines removes lines correctly 3`] = `
Object { {
"code": "aaaaa "code": "aaaaa
bbbbbbb bbbbbbb
bbbbb", bbbbb",
"highlightLines": Array [ "highlightLines": [
0, 0,
2, 2,
0, 0,
@ -75,25 +75,25 @@ bbbbb",
`; `;
exports[`parseLines respects language 1`] = ` exports[`parseLines respects language 1`] = `
Object { {
"code": "# highlight-next-line "code": "# highlight-next-line
aaaaa aaaaa
bbbbb", bbbbb",
"highlightLines": Array [], "highlightLines": [],
} }
`; `;
exports[`parseLines respects language 2`] = ` exports[`parseLines respects language 2`] = `
Object { {
"code": "/* highlight-next-line */ "code": "/* highlight-next-line */
aaaaa aaaaa
bbbbb", bbbbb",
"highlightLines": Array [], "highlightLines": [],
} }
`; `;
exports[`parseLines respects language 3`] = ` exports[`parseLines respects language 3`] = `
Object { {
"code": "// highlight-next-line "code": "// highlight-next-line
aaaa aaaa
/* highlight-next-line */ /* highlight-next-line */
@ -101,19 +101,19 @@ bbbbb
ccccc ccccc
<!-- highlight-next-line --> <!-- highlight-next-line -->
dddd", dddd",
"highlightLines": Array [ "highlightLines": [
4, 4,
], ],
} }
`; `;
exports[`parseLines respects language 4`] = ` exports[`parseLines respects language 4`] = `
Object { {
"code": "aaaa "code": "aaaa
bbbbb bbbbb
ccccc ccccc
dddd", dddd",
"highlightLines": Array [ "highlightLines": [
0, 0,
1, 1,
2, 2,

View file

@ -1,17 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`useTreeifiedTOC treeifies TOC without filtering 1`] = ` exports[`useTreeifiedTOC treeifies TOC without filtering 1`] = `
Array [ [
Object { {
"children": Array [ "children": [
Object { {
"children": Array [ "children": [
Object { {
"children": Array [ "children": [
Object { {
"children": Array [ "children": [
Object { {
"children": Array [], "children": [],
"id": "foxtrot", "id": "foxtrot",
"level": 6, "level": 6,
"value": "Foxtrot", "value": "Foxtrot",

View file

@ -1,10 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`replaceMarkdownLinks does basic replace 1`] = ` exports[`replaceMarkdownLinks does basic replace 1`] = `
Object { {
"brokenMarkdownLinks": Array [ "brokenMarkdownLinks": [
Object { {
"contentPaths": Object { "contentPaths": {
"contentPath": "docs", "contentPath": "docs",
"contentPathLocalized": "i18n/docs-localized", "contentPathLocalized": "i18n/docs-localized",
}, },
@ -27,18 +27,18 @@ Object {
`; `;
exports[`replaceMarkdownLinks ignores links in HTML comments 1`] = ` exports[`replaceMarkdownLinks ignores links in HTML comments 1`] = `
Object { {
"brokenMarkdownLinks": Array [ "brokenMarkdownLinks": [
Object { {
"contentPaths": Object { "contentPaths": {
"contentPath": "docs", "contentPath": "docs",
"contentPathLocalized": "i18n/docs-localized", "contentPathLocalized": "i18n/docs-localized",
}, },
"filePath": "docs/intro.md", "filePath": "docs/intro.md",
"link": "./foo.md", "link": "./foo.md",
}, },
Object { {
"contentPaths": Object { "contentPaths": {
"contentPath": "docs", "contentPath": "docs",
"contentPathLocalized": "i18n/docs-localized", "contentPathLocalized": "i18n/docs-localized",
}, },
@ -56,8 +56,8 @@ Object {
`; `;
exports[`replaceMarkdownLinks ignores links in fenced blocks 1`] = ` exports[`replaceMarkdownLinks ignores links in fenced blocks 1`] = `
Object { {
"brokenMarkdownLinks": Array [], "brokenMarkdownLinks": [],
"newContent": " "newContent": "
\`\`\` \`\`\`
[foo](foo.md) [foo](foo.md)
@ -81,10 +81,10 @@ Object {
`; `;
exports[`replaceMarkdownLinks ignores links in inline code 1`] = ` exports[`replaceMarkdownLinks ignores links in inline code 1`] = `
Object { {
"brokenMarkdownLinks": Array [ "brokenMarkdownLinks": [
Object { {
"contentPaths": Object { "contentPaths": {
"contentPath": "docs", "contentPath": "docs",
"contentPathLocalized": "i18n/docs-localized", "contentPathLocalized": "i18n/docs-localized",
}, },
@ -99,8 +99,8 @@ Object {
`; `;
exports[`replaceMarkdownLinks replaces links with same title as URL 1`] = ` exports[`replaceMarkdownLinks replaces links with same title as URL 1`] = `
Object { {
"brokenMarkdownLinks": Array [], "brokenMarkdownLinks": [],
"newContent": " "newContent": "
[/docs/foo](foo.md) [/docs/foo](foo.md)
[/docs/foo](./foo.md) [/docs/foo](./foo.md)
@ -111,8 +111,8 @@ Object {
`; `;
exports[`replaceMarkdownLinks replaces multiple links on same line 1`] = ` exports[`replaceMarkdownLinks replaces multiple links on same line 1`] = `
Object { {
"brokenMarkdownLinks": Array [], "brokenMarkdownLinks": [],
"newContent": " "newContent": "
[a](/docs/a), [a](/docs/a), [b](/docs/b), [c](/docs/c) [a](/docs/a), [a](/docs/a), [b](/docs/b), [c](/docs/c)
", ",
@ -120,8 +120,8 @@ Object {
`; `;
exports[`replaceMarkdownLinks replaces reference style Markdown links 1`] = ` exports[`replaceMarkdownLinks replaces reference style Markdown links 1`] = `
Object { {
"brokenMarkdownLinks": Array [], "brokenMarkdownLinks": [],
"newContent": " "newContent": "
The following operations are defined for [URI]s: The following operations are defined for [URI]s:

View file

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`parseMarkdownString deletes only first heading 1`] = ` exports[`parseMarkdownString deletes only first heading 1`] = `
Object { {
"content": "# Markdown Title "content": "# Markdown Title
test test test # test bar test test test # test bar
@ -11,12 +11,12 @@ test test test # test bar
### Markdown Title h3", ### Markdown Title h3",
"contentTitle": "Markdown Title", "contentTitle": "Markdown Title",
"excerpt": "test test test # test bar", "excerpt": "test test test # test bar",
"frontMatter": Object {}, "frontMatter": {},
} }
`; `;
exports[`parseMarkdownString deletes only first heading 2 1`] = ` exports[`parseMarkdownString deletes only first heading 2 1`] = `
Object { {
"content": "# test "content": "# test
test test test test test test test test test test test test
@ -26,25 +26,25 @@ test test test # test bar
test3", test3",
"contentTitle": "test", "contentTitle": "test",
"excerpt": "test test test test test test", "excerpt": "test test test test test test",
"frontMatter": Object {}, "frontMatter": {},
} }
`; `;
exports[`parseMarkdownString does not warn for duplicate title if markdown title is not at the top 1`] = ` exports[`parseMarkdownString does not warn for duplicate title if markdown title is not at the top 1`] = `
Object { {
"content": "foo "content": "foo
# Markdown Title", # Markdown Title",
"contentTitle": undefined, "contentTitle": undefined,
"excerpt": "foo", "excerpt": "foo",
"frontMatter": Object { "frontMatter": {
"title": "Frontmatter title", "title": "Frontmatter title",
}, },
} }
`; `;
exports[`parseMarkdownString handles code blocks 1`] = ` exports[`parseMarkdownString handles code blocks 1`] = `
Object { {
"content": "\`\`\`js "content": "\`\`\`js
code code
\`\`\` \`\`\`
@ -52,12 +52,12 @@ code
Content", Content",
"contentTitle": undefined, "contentTitle": undefined,
"excerpt": "Content", "excerpt": "Content",
"frontMatter": Object {}, "frontMatter": {},
} }
`; `;
exports[`parseMarkdownString handles code blocks 2`] = ` exports[`parseMarkdownString handles code blocks 2`] = `
Object { {
"content": "\`\`\`\`js "content": "\`\`\`\`js
Foo Foo
\`\`\`diff \`\`\`diff
@ -69,12 +69,12 @@ Bar
Content", Content",
"contentTitle": undefined, "contentTitle": undefined,
"excerpt": "Content", "excerpt": "Content",
"frontMatter": Object {}, "frontMatter": {},
} }
`; `;
exports[`parseMarkdownString handles code blocks 3`] = ` exports[`parseMarkdownString handles code blocks 3`] = `
Object { {
"content": "\`\`\`\`js "content": "\`\`\`\`js
Foo Foo
\`\`\`diff \`\`\`diff
@ -84,116 +84,116 @@ code
Content", Content",
"contentTitle": undefined, "contentTitle": undefined,
"excerpt": "Content", "excerpt": "Content",
"frontMatter": Object {}, "frontMatter": {},
} }
`; `;
exports[`parseMarkdownString ignores markdown title if its not a first text 1`] = ` exports[`parseMarkdownString ignores markdown title if its not a first text 1`] = `
Object { {
"content": "foo "content": "foo
# test", # test",
"contentTitle": undefined, "contentTitle": undefined,
"excerpt": "foo", "excerpt": "foo",
"frontMatter": Object {}, "frontMatter": {},
} }
`; `;
exports[`parseMarkdownString parse markdown with front matter 1`] = ` exports[`parseMarkdownString parse markdown with front matter 1`] = `
Object { {
"content": "Some text", "content": "Some text",
"contentTitle": undefined, "contentTitle": undefined,
"excerpt": "Some text", "excerpt": "Some text",
"frontMatter": Object { "frontMatter": {
"title": "Frontmatter title", "title": "Frontmatter title",
}, },
} }
`; `;
exports[`parseMarkdownString parses first heading as contentTitle 1`] = ` exports[`parseMarkdownString parses first heading as contentTitle 1`] = `
Object { {
"content": "# Markdown Title "content": "# Markdown Title
Some text", Some text",
"contentTitle": "Markdown Title", "contentTitle": "Markdown Title",
"excerpt": "Some text", "excerpt": "Some text",
"frontMatter": Object {}, "frontMatter": {},
} }
`; `;
exports[`parseMarkdownString parses front-matter and ignore h2 1`] = ` exports[`parseMarkdownString parses front-matter and ignore h2 1`] = `
Object { {
"content": "## test", "content": "## test",
"contentTitle": undefined, "contentTitle": undefined,
"excerpt": "test", "excerpt": "test",
"frontMatter": Object { "frontMatter": {
"title": "Frontmatter title", "title": "Frontmatter title",
}, },
} }
`; `;
exports[`parseMarkdownString parses title only 1`] = ` exports[`parseMarkdownString parses title only 1`] = `
Object { {
"content": "# test", "content": "# test",
"contentTitle": "test", "contentTitle": "test",
"excerpt": undefined, "excerpt": undefined,
"frontMatter": Object {}, "frontMatter": {},
} }
`; `;
exports[`parseMarkdownString parses title only alternate 1`] = ` exports[`parseMarkdownString parses title only alternate 1`] = `
Object { {
"content": "test "content": "test
===", ===",
"contentTitle": "test", "contentTitle": "test",
"excerpt": undefined, "excerpt": undefined,
"frontMatter": Object {}, "frontMatter": {},
} }
`; `;
exports[`parseMarkdownString reads front matter only 1`] = ` exports[`parseMarkdownString reads front matter only 1`] = `
Object { {
"content": "", "content": "",
"contentTitle": undefined, "contentTitle": undefined,
"excerpt": undefined, "excerpt": undefined,
"frontMatter": Object { "frontMatter": {
"title": "test", "title": "test",
}, },
} }
`; `;
exports[`parseMarkdownString warns about duplicate titles (front matter + markdown alternate) 1`] = ` exports[`parseMarkdownString warns about duplicate titles (front matter + markdown alternate) 1`] = `
Object { {
"content": "Markdown Title alternate "content": "Markdown Title alternate
================ ================
Some text", Some text",
"contentTitle": "Markdown Title alternate", "contentTitle": "Markdown Title alternate",
"excerpt": "Some text", "excerpt": "Some text",
"frontMatter": Object { "frontMatter": {
"title": "Frontmatter title", "title": "Frontmatter title",
}, },
} }
`; `;
exports[`parseMarkdownString warns about duplicate titles (front matter + markdown) 1`] = ` exports[`parseMarkdownString warns about duplicate titles (front matter + markdown) 1`] = `
Object { {
"content": "# Markdown Title "content": "# Markdown Title
Some text", Some text",
"contentTitle": "Markdown Title", "contentTitle": "Markdown Title",
"excerpt": "Some text", "excerpt": "Some text",
"frontMatter": Object { "frontMatter": {
"title": "Frontmatter title", "title": "Frontmatter title",
}, },
} }
`; `;
exports[`parseMarkdownString warns about duplicate titles 1`] = ` exports[`parseMarkdownString warns about duplicate titles 1`] = `
Object { {
"content": "# test", "content": "# test",
"contentTitle": "test", "contentTitle": "test",
"excerpt": undefined, "excerpt": undefined,
"frontMatter": Object { "frontMatter": {
"title": "Frontmatter title", "title": "Frontmatter title",
}, },
} }

View file

@ -3,14 +3,29 @@
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*
* @jest-environment jsdom
*/ */
// Jest doesn't allow pragma below other comments. https://github.com/facebook/jest/issues/12573
// eslint-disable-next-line header/header
import React from 'react'; import React from 'react';
import renderer from 'react-test-renderer'; import renderer from 'react-test-renderer';
import BrowserOnly from '../BrowserOnly'; import BrowserOnly from '../BrowserOnly';
import {Context} from '../browserContext'; import {Context} from '../browserContext';
describe('<BrowserOnly>', () => { describe('<BrowserOnly>', () => {
const originalEnv = process.env;
beforeEach(() => {
jest.resetModules();
process.env = {...originalEnv};
});
afterAll(() => {
process.env = originalEnv;
});
it('rejects react element children', () => { it('rejects react element children', () => {
process.env.NODE_ENV = 'development'; process.env.NODE_ENV = 'development';
expect(() => expect(() =>
@ -58,7 +73,7 @@ describe('<BrowserOnly>', () => {
.toJSON(), .toJSON(),
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
<span> <span>
https://docusaurus.io https://docusaurus.io/
</span> </span>
`); `);
}); });

View file

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Interpolate> acceptance test 1`] = ` exports[`<Interpolate> acceptance test 1`] = `
Array [ [
"Hello ", "Hello ",
"Sébastien", "Sébastien",
" how are you ", " how are you ",
@ -13,7 +13,7 @@ Array [
`; `;
exports[`interpolate acceptance test 1`] = ` exports[`interpolate acceptance test 1`] = `
Array [ [
<React.Fragment> <React.Fragment>
Hello Hello
Sébastien Sébastien
@ -31,7 +31,7 @@ Array [
`; `;
exports[`interpolate placeholders with JSX values 1`] = ` exports[`interpolate placeholders with JSX values 1`] = `
Array [ [
<React.Fragment> <React.Fragment>
Hello Hello
<b> <b>
@ -51,7 +51,7 @@ Array [
`; `;
exports[`interpolate placeholders with mixed vales 1`] = ` exports[`interpolate placeholders with mixed vales 1`] = `
Array [ [
<React.Fragment> <React.Fragment>
Hello Hello
Sébastien Sébastien

View file

@ -25,12 +25,12 @@ describe('DocusaurusContextProvider', () => {
const value = result.current; const value = result.current;
it('returns right value', () => { it('returns right value', () => {
expect(value).toMatchInlineSnapshot(` expect(value).toMatchInlineSnapshot(`
Object { {
"codeTranslations": Object {}, "codeTranslations": {},
"globalData": Object {}, "globalData": {},
"i18n": Object {}, "i18n": {},
"siteConfig": Object {}, "siteConfig": {},
"siteMetadata": Object {}, "siteMetadata": {},
} }
`); `);
}); });

View file

@ -1,16 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`normalizeSwizzleConfig normalize partial config 1`] = ` exports[`normalizeSwizzleConfig normalize partial config 1`] = `
Object { {
"components": Object { "components": {
"Other/Component": Object { "Other/Component": {
"actions": Object { "actions": {
"eject": "unsafe", "eject": "unsafe",
"wrap": "forbidden", "wrap": "forbidden",
}, },
}, },
"SomeComponent": Object { "SomeComponent": {
"actions": Object { "actions": {
"eject": "safe", "eject": "safe",
"wrap": "unsafe", "wrap": "unsafe",
}, },

View file

@ -77,8 +77,8 @@ describe('getThemeComponents', () => {
}); });
expect(themeComponents.getConfig(Components.ComponentInFolder)) expect(themeComponents.getConfig(Components.ComponentInFolder))
.toMatchInlineSnapshot(` .toMatchInlineSnapshot(`
Object { {
"actions": Object { "actions": {
"eject": "unsafe", "eject": "unsafe",
"wrap": "safe", "wrap": "safe",
}, },
@ -87,8 +87,8 @@ describe('getThemeComponents', () => {
`); `);
expect(themeComponents.getConfig(Components.ComponentInSubFolder)) expect(themeComponents.getConfig(Components.ComponentInSubFolder))
.toMatchInlineSnapshot(` .toMatchInlineSnapshot(`
Object { {
"actions": Object { "actions": {
"eject": "safe", "eject": "safe",
"wrap": "unsafe", "wrap": "unsafe",
}, },
@ -96,8 +96,8 @@ describe('getThemeComponents', () => {
`); `);
expect(themeComponents.getConfig(Components.FirstLevelComponent)) expect(themeComponents.getConfig(Components.FirstLevelComponent))
.toMatchInlineSnapshot(` .toMatchInlineSnapshot(`
Object { {
"actions": Object { "actions": {
"eject": "unsafe", "eject": "unsafe",
"wrap": "unsafe", "wrap": "unsafe",
}, },

View file

@ -12,15 +12,15 @@ See https://docusaurus.io/docs/docusaurus.config.js/#customfields"
`; `;
exports[`loadConfig website with valid async config 1`] = ` exports[`loadConfig website with valid async config 1`] = `
Object { {
"baseUrl": "/", "baseUrl": "/",
"baseUrlIssueBanner": true, "baseUrlIssueBanner": true,
"clientModules": Array [], "clientModules": [],
"customFields": Object {}, "customFields": {},
"i18n": Object { "i18n": {
"defaultLocale": "en", "defaultLocale": "en",
"localeConfigs": Object {}, "localeConfigs": {},
"locales": Array [ "locales": [
"en", "en",
], ],
}, },
@ -29,17 +29,17 @@ Object {
"onBrokenMarkdownLinks": "warn", "onBrokenMarkdownLinks": "warn",
"onDuplicateRoutes": "warn", "onDuplicateRoutes": "warn",
"organizationName": "endiliey", "organizationName": "endiliey",
"plugins": Array [], "plugins": [],
"presets": Array [], "presets": [],
"projectName": "hello", "projectName": "hello",
"scripts": Array [], "scripts": [],
"staticDirectories": Array [ "staticDirectories": [
"static", "static",
], ],
"stylesheets": Array [], "stylesheets": [],
"tagline": "Hello World", "tagline": "Hello World",
"themeConfig": Object {}, "themeConfig": {},
"themes": Array [], "themes": [],
"title": "Hello", "title": "Hello",
"titleDelimiter": "|", "titleDelimiter": "|",
"url": "https://docusaurus.io", "url": "https://docusaurus.io",
@ -47,15 +47,15 @@ Object {
`; `;
exports[`loadConfig website with valid async config creator function 1`] = ` exports[`loadConfig website with valid async config creator function 1`] = `
Object { {
"baseUrl": "/", "baseUrl": "/",
"baseUrlIssueBanner": true, "baseUrlIssueBanner": true,
"clientModules": Array [], "clientModules": [],
"customFields": Object {}, "customFields": {},
"i18n": Object { "i18n": {
"defaultLocale": "en", "defaultLocale": "en",
"localeConfigs": Object {}, "localeConfigs": {},
"locales": Array [ "locales": [
"en", "en",
], ],
}, },
@ -64,17 +64,17 @@ Object {
"onBrokenMarkdownLinks": "warn", "onBrokenMarkdownLinks": "warn",
"onDuplicateRoutes": "warn", "onDuplicateRoutes": "warn",
"organizationName": "endiliey", "organizationName": "endiliey",
"plugins": Array [], "plugins": [],
"presets": Array [], "presets": [],
"projectName": "hello", "projectName": "hello",
"scripts": Array [], "scripts": [],
"staticDirectories": Array [ "staticDirectories": [
"static", "static",
], ],
"stylesheets": Array [], "stylesheets": [],
"tagline": "Hello World", "tagline": "Hello World",
"themeConfig": Object {}, "themeConfig": {},
"themes": Array [], "themes": [],
"title": "Hello", "title": "Hello",
"titleDelimiter": "|", "titleDelimiter": "|",
"url": "https://docusaurus.io", "url": "https://docusaurus.io",
@ -82,15 +82,15 @@ Object {
`; `;
exports[`loadConfig website with valid config creator function 1`] = ` exports[`loadConfig website with valid config creator function 1`] = `
Object { {
"baseUrl": "/", "baseUrl": "/",
"baseUrlIssueBanner": true, "baseUrlIssueBanner": true,
"clientModules": Array [], "clientModules": [],
"customFields": Object {}, "customFields": {},
"i18n": Object { "i18n": {
"defaultLocale": "en", "defaultLocale": "en",
"localeConfigs": Object {}, "localeConfigs": {},
"locales": Array [ "locales": [
"en", "en",
], ],
}, },
@ -99,17 +99,17 @@ Object {
"onBrokenMarkdownLinks": "warn", "onBrokenMarkdownLinks": "warn",
"onDuplicateRoutes": "warn", "onDuplicateRoutes": "warn",
"organizationName": "endiliey", "organizationName": "endiliey",
"plugins": Array [], "plugins": [],
"presets": Array [], "presets": [],
"projectName": "hello", "projectName": "hello",
"scripts": Array [], "scripts": [],
"staticDirectories": Array [ "staticDirectories": [
"static", "static",
], ],
"stylesheets": Array [], "stylesheets": [],
"tagline": "Hello World", "tagline": "Hello World",
"themeConfig": Object {}, "themeConfig": {},
"themes": Array [], "themes": [],
"title": "Hello", "title": "Hello",
"titleDelimiter": "|", "titleDelimiter": "|",
"url": "https://docusaurus.io", "url": "https://docusaurus.io",
@ -117,16 +117,16 @@ Object {
`; `;
exports[`loadConfig website with valid siteConfig 1`] = ` exports[`loadConfig website with valid siteConfig 1`] = `
Object { {
"baseUrl": "/", "baseUrl": "/",
"baseUrlIssueBanner": true, "baseUrlIssueBanner": true,
"clientModules": Array [], "clientModules": [],
"customFields": Object {}, "customFields": {},
"favicon": "img/docusaurus.ico", "favicon": "img/docusaurus.ico",
"i18n": Object { "i18n": {
"defaultLocale": "en", "defaultLocale": "en",
"localeConfigs": Object {}, "localeConfigs": {},
"locales": Array [ "locales": [
"en", "en",
], ],
}, },
@ -135,25 +135,25 @@ Object {
"onBrokenMarkdownLinks": "warn", "onBrokenMarkdownLinks": "warn",
"onDuplicateRoutes": "warn", "onDuplicateRoutes": "warn",
"organizationName": "endiliey", "organizationName": "endiliey",
"plugins": Array [ "plugins": [
Array [ [
"@docusaurus/plugin-content-docs", "@docusaurus/plugin-content-docs",
Object { {
"path": "../docs", "path": "../docs",
}, },
], ],
"@docusaurus/plugin-content-pages", "@docusaurus/plugin-content-pages",
], ],
"presets": Array [], "presets": [],
"projectName": "hello", "projectName": "hello",
"scripts": Array [], "scripts": [],
"staticDirectories": Array [ "staticDirectories": [
"static", "static",
], ],
"stylesheets": Array [], "stylesheets": [],
"tagline": "Hello World", "tagline": "Hello World",
"themeConfig": Object {}, "themeConfig": {},
"themes": Array [], "themes": [],
"title": "Hello", "title": "Hello",
"titleDelimiter": "|", "titleDelimiter": "|",
"url": "https://docusaurus.io", "url": "https://docusaurus.io",

View file

@ -1,34 +1,34 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`loadRoutes loads flat route config 1`] = ` exports[`loadRoutes loads flat route config 1`] = `
Object { {
"registry": Object { "registry": {
"component---theme-blog-list-pagea-6-a-7ba": Object { "component---theme-blog-list-pagea-6-a-7ba": {
"loader": "() => import(/* webpackChunkName: 'component---theme-blog-list-pagea-6-a-7ba' */ '@theme/BlogListPage')", "loader": "() => import(/* webpackChunkName: 'component---theme-blog-list-pagea-6-a-7ba' */ '@theme/BlogListPage')",
"modulePath": "@theme/BlogListPage", "modulePath": "@theme/BlogListPage",
}, },
"content---blog-0-b-4-09e": Object { "content---blog-0-b-4-09e": {
"loader": "() => import(/* webpackChunkName: 'content---blog-0-b-4-09e' */ 'blog/2018-12-14-Happy-First-Birthday-Slash.md?truncated=true')", "loader": "() => import(/* webpackChunkName: 'content---blog-0-b-4-09e' */ 'blog/2018-12-14-Happy-First-Birthday-Slash.md?truncated=true')",
"modulePath": "blog/2018-12-14-Happy-First-Birthday-Slash.md?truncated=true", "modulePath": "blog/2018-12-14-Happy-First-Birthday-Slash.md?truncated=true",
}, },
"content---blog-7-b-8-fd9": Object { "content---blog-7-b-8-fd9": {
"loader": "() => import(/* webpackChunkName: 'content---blog-7-b-8-fd9' */ 'blog/2018-12-14-Happy-First-Birthday-Slash.md')", "loader": "() => import(/* webpackChunkName: 'content---blog-7-b-8-fd9' */ 'blog/2018-12-14-Happy-First-Birthday-Slash.md')",
"modulePath": "blog/2018-12-14-Happy-First-Birthday-Slash.md", "modulePath": "blog/2018-12-14-Happy-First-Birthday-Slash.md",
}, },
"metadata---blog-0-b-6-74c": Object { "metadata---blog-0-b-6-74c": {
"loader": "() => import(/* webpackChunkName: 'metadata---blog-0-b-6-74c' */ 'blog-2018-12-14-happy-first-birthday-slash-d2c.json')", "loader": "() => import(/* webpackChunkName: 'metadata---blog-0-b-6-74c' */ 'blog-2018-12-14-happy-first-birthday-slash-d2c.json')",
"modulePath": "blog-2018-12-14-happy-first-birthday-slash-d2c.json", "modulePath": "blog-2018-12-14-happy-first-birthday-slash-d2c.json",
}, },
}, },
"routesChunkNames": Object { "routesChunkNames": {
"/blog-94e": Object { "/blog-94e": {
"component": "component---theme-blog-list-pagea-6-a-7ba", "component": "component---theme-blog-list-pagea-6-a-7ba",
"items": Array [ "items": [
Object { {
"content": "content---blog-0-b-4-09e", "content": "content---blog-0-b-4-09e",
"metadata": "metadata---blog-0-b-6-74c", "metadata": "metadata---blog-0-b-6-74c",
}, },
Object { {
"content": "content---blog-7-b-8-fd9", "content": "content---blog-7-b-8-fd9",
"metadata": null, "metadata": null,
}, },
@ -51,7 +51,7 @@ export default [
} }
]; ];
", ",
"routesPaths": Array [ "routesPaths": [
"/404.html", "/404.html",
"/blog", "/blog",
], ],
@ -59,48 +59,48 @@ export default [
`; `;
exports[`loadRoutes loads nested route config 1`] = ` exports[`loadRoutes loads nested route config 1`] = `
Object { {
"registry": Object { "registry": {
"component---theme-doc-item-178-a40": Object { "component---theme-doc-item-178-a40": {
"loader": "() => import(/* webpackChunkName: 'component---theme-doc-item-178-a40' */ '@theme/DocItem')", "loader": "() => import(/* webpackChunkName: 'component---theme-doc-item-178-a40' */ '@theme/DocItem')",
"modulePath": "@theme/DocItem", "modulePath": "@theme/DocItem",
}, },
"component---theme-doc-page-1-be-9be": Object { "component---theme-doc-page-1-be-9be": {
"loader": "() => import(/* webpackChunkName: 'component---theme-doc-page-1-be-9be' */ '@theme/DocPage')", "loader": "() => import(/* webpackChunkName: 'component---theme-doc-page-1-be-9be' */ '@theme/DocPage')",
"modulePath": "@theme/DocPage", "modulePath": "@theme/DocPage",
}, },
"content---docs-foo-baz-8-ce-61e": Object { "content---docs-foo-baz-8-ce-61e": {
"loader": "() => import(/* webpackChunkName: 'content---docs-foo-baz-8-ce-61e' */ 'docs/foo/baz.md')", "loader": "() => import(/* webpackChunkName: 'content---docs-foo-baz-8-ce-61e' */ 'docs/foo/baz.md')",
"modulePath": "docs/foo/baz.md", "modulePath": "docs/foo/baz.md",
}, },
"content---docs-helloaff-811": Object { "content---docs-helloaff-811": {
"loader": "() => import(/* webpackChunkName: 'content---docs-helloaff-811' */ 'docs/hello.md')", "loader": "() => import(/* webpackChunkName: 'content---docs-helloaff-811' */ 'docs/hello.md')",
"modulePath": "docs/hello.md", "modulePath": "docs/hello.md",
}, },
"docsMetadata---docs-routef-34-881": Object { "docsMetadata---docs-routef-34-881": {
"loader": "() => import(/* webpackChunkName: 'docsMetadata---docs-routef-34-881' */ 'docs-b5f.json')", "loader": "() => import(/* webpackChunkName: 'docsMetadata---docs-routef-34-881' */ 'docs-b5f.json')",
"modulePath": "docs-b5f.json", "modulePath": "docs-b5f.json",
}, },
"metadata---docs-foo-baz-2-cf-fa7": Object { "metadata---docs-foo-baz-2-cf-fa7": {
"loader": "() => import(/* webpackChunkName: 'metadata---docs-foo-baz-2-cf-fa7' */ 'docs-foo-baz-dd9.json')", "loader": "() => import(/* webpackChunkName: 'metadata---docs-foo-baz-2-cf-fa7' */ 'docs-foo-baz-dd9.json')",
"modulePath": "docs-foo-baz-dd9.json", "modulePath": "docs-foo-baz-dd9.json",
}, },
"metadata---docs-hello-956-741": Object { "metadata---docs-hello-956-741": {
"loader": "() => import(/* webpackChunkName: 'metadata---docs-hello-956-741' */ 'docs-hello-da2.json')", "loader": "() => import(/* webpackChunkName: 'metadata---docs-hello-956-741' */ 'docs-hello-da2.json')",
"modulePath": "docs-hello-da2.json", "modulePath": "docs-hello-da2.json",
}, },
}, },
"routesChunkNames": Object { "routesChunkNames": {
"/docs/hello-44b": Object { "/docs/hello-44b": {
"component": "component---theme-doc-item-178-a40", "component": "component---theme-doc-item-178-a40",
"content": "content---docs-helloaff-811", "content": "content---docs-helloaff-811",
"metadata": "metadata---docs-hello-956-741", "metadata": "metadata---docs-hello-956-741",
}, },
"/docs:route-63b": Object { "/docs:route-63b": {
"component": "component---theme-doc-page-1-be-9be", "component": "component---theme-doc-page-1-be-9be",
"docsMetadata": "docsMetadata---docs-routef-34-881", "docsMetadata": "docsMetadata---docs-routef-34-881",
}, },
"docs/foo/baz-ac2": Object { "docs/foo/baz-ac2": {
"component": "component---theme-doc-item-178-a40", "component": "component---theme-doc-item-178-a40",
"content": "content---docs-foo-baz-8-ce-61e", "content": "content---docs-foo-baz-8-ce-61e",
"metadata": "metadata---docs-foo-baz-2-cf-fa7", "metadata": "metadata---docs-foo-baz-2-cf-fa7",
@ -134,7 +134,7 @@ export default [
} }
]; ];
", ",
"routesPaths": Array [ "routesPaths": [
"/404.html", "/404.html",
"/docs/hello", "/docs/hello",
"docs/foo/baz", "docs/foo/baz",
@ -143,15 +143,15 @@ export default [
`; `;
exports[`loadRoutes loads route config with empty (but valid) path string 1`] = ` exports[`loadRoutes loads route config with empty (but valid) path string 1`] = `
Object { {
"registry": Object { "registry": {
"component---hello-world-jse-0-f-b6c": Object { "component---hello-world-jse-0-f-b6c": {
"loader": "() => import(/* webpackChunkName: 'component---hello-world-jse-0-f-b6c' */ 'hello/world.js')", "loader": "() => import(/* webpackChunkName: 'component---hello-world-jse-0-f-b6c' */ 'hello/world.js')",
"modulePath": "hello/world.js", "modulePath": "hello/world.js",
}, },
}, },
"routesChunkNames": Object { "routesChunkNames": {
"-b2a": Object { "-b2a": {
"component": "component---hello-world-jse-0-f-b6c", "component": "component---hello-world-jse-0-f-b6c",
}, },
}, },
@ -170,7 +170,7 @@ export default [
} }
]; ];
", ",
"routesPaths": Array [ "routesPaths": [
"/404.html", "/404.html",
"", "",
], ],

View file

@ -14,13 +14,13 @@ import pluginHelloWorld from './__fixtures__/plugin-hello-world';
describe('loadClientModules', () => { describe('loadClientModules', () => {
it('empty', () => { it('empty', () => {
const clientModules = loadClientModules([pluginEmpty()]); const clientModules = loadClientModules([pluginEmpty()]);
expect(clientModules).toMatchInlineSnapshot(`Array []`); expect(clientModules).toMatchInlineSnapshot(`[]`);
}); });
it('non-empty', () => { it('non-empty', () => {
const clientModules = loadClientModules([pluginFooBar()]); const clientModules = loadClientModules([pluginFooBar()]);
expect(clientModules).toMatchInlineSnapshot(` expect(clientModules).toMatchInlineSnapshot(`
Array [ [
"foo", "foo",
"bar", "bar",
] ]
@ -33,7 +33,7 @@ describe('loadClientModules', () => {
pluginHelloWorld(), pluginHelloWorld(),
]); ]);
expect(clientModules).toMatchInlineSnapshot(` expect(clientModules).toMatchInlineSnapshot(`
Array [ [
"foo", "foo",
"bar", "bar",
"hello", "hello",
@ -48,7 +48,7 @@ describe('loadClientModules', () => {
pluginFooBar(), pluginFooBar(),
]); ]);
expect(clientModules).toMatchInlineSnapshot(` expect(clientModules).toMatchInlineSnapshot(`
Array [ [
"hello", "hello",
"world", "world",
"foo", "foo",
@ -64,7 +64,7 @@ describe('loadClientModules', () => {
pluginFooBar(), pluginFooBar(),
]); ]);
expect(clientModules).toMatchInlineSnapshot(` expect(clientModules).toMatchInlineSnapshot(`
Array [ [
"hello", "hello",
"world", "world",
"foo", "foo",
@ -80,7 +80,7 @@ describe('loadClientModules', () => {
pluginEmpty(), pluginEmpty(),
]); ]);
expect(clientModules).toMatchInlineSnapshot(` expect(clientModules).toMatchInlineSnapshot(`
Array [ [
"hello", "hello",
"world", "world",
"foo", "foo",

View file

@ -16,7 +16,7 @@ describe('loadHtmlTags', () => {
it('empty plugin', () => { it('empty plugin', () => {
const htmlTags = loadHtmlTags([pluginEmpty()]); const htmlTags = loadHtmlTags([pluginEmpty()]);
expect(htmlTags).toMatchInlineSnapshot(` expect(htmlTags).toMatchInlineSnapshot(`
Object { {
"headTags": "", "headTags": "",
"postBodyTags": "", "postBodyTags": "",
"preBodyTags": "", "preBodyTags": "",
@ -27,7 +27,7 @@ describe('loadHtmlTags', () => {
it('only inject headTags', () => { it('only inject headTags', () => {
const htmlTags = loadHtmlTags([pluginHeadTags()]); const htmlTags = loadHtmlTags([pluginHeadTags()]);
expect(htmlTags).toMatchInlineSnapshot(` expect(htmlTags).toMatchInlineSnapshot(`
Object { {
"headTags": "<link rel=\\"preconnect\\" href=\\"www.google-analytics.com\\"> "headTags": "<link rel=\\"preconnect\\" href=\\"www.google-analytics.com\\">
<meta name=\\"generator\\" content=\\"docusaurus\\">", <meta name=\\"generator\\" content=\\"docusaurus\\">",
"postBodyTags": "", "postBodyTags": "",
@ -39,7 +39,7 @@ describe('loadHtmlTags', () => {
it('only inject preBodyTags', () => { it('only inject preBodyTags', () => {
const htmlTags = loadHtmlTags([pluginPreBodyTags()]); const htmlTags = loadHtmlTags([pluginPreBodyTags()]);
expect(htmlTags).toMatchInlineSnapshot(` expect(htmlTags).toMatchInlineSnapshot(`
Object { {
"headTags": "", "headTags": "",
"postBodyTags": "", "postBodyTags": "",
"preBodyTags": "<script type=\\"text/javascript\\">window.foo = null;</script>", "preBodyTags": "<script type=\\"text/javascript\\">window.foo = null;</script>",
@ -50,7 +50,7 @@ describe('loadHtmlTags', () => {
it('only inject postBodyTags', () => { it('only inject postBodyTags', () => {
const htmlTags = loadHtmlTags([pluginPostBodyTags()]); const htmlTags = loadHtmlTags([pluginPostBodyTags()]);
expect(htmlTags).toMatchInlineSnapshot(` expect(htmlTags).toMatchInlineSnapshot(`
Object { {
"headTags": "", "headTags": "",
"postBodyTags": "<div>Test content</div>", "postBodyTags": "<div>Test content</div>",
"preBodyTags": "", "preBodyTags": "",
@ -65,7 +65,7 @@ describe('loadHtmlTags', () => {
pluginPreBodyTags(), pluginPreBodyTags(),
]); ]);
expect(htmlTags).toMatchInlineSnapshot(` expect(htmlTags).toMatchInlineSnapshot(`
Object { {
"headTags": "<link rel=\\"preconnect\\" href=\\"www.google-analytics.com\\"> "headTags": "<link rel=\\"preconnect\\" href=\\"www.google-analytics.com\\">
<meta name=\\"generator\\" content=\\"docusaurus\\">", <meta name=\\"generator\\" content=\\"docusaurus\\">",
"postBodyTags": "<div>Test content</div>", "postBodyTags": "<div>Test content</div>",
@ -81,7 +81,7 @@ describe('loadHtmlTags', () => {
pluginPostBodyTags(), pluginPostBodyTags(),
]); ]);
expect(htmlTags).toMatchInlineSnapshot(` expect(htmlTags).toMatchInlineSnapshot(`
Object { {
"headTags": "<link rel=\\"preconnect\\" href=\\"www.google-analytics.com\\"> "headTags": "<link rel=\\"preconnect\\" href=\\"www.google-analytics.com\\">
<meta name=\\"generator\\" content=\\"docusaurus\\">", <meta name=\\"generator\\" content=\\"docusaurus\\">",
"postBodyTags": "<div>Test content</div>", "postBodyTags": "<div>Test content</div>",

View file

@ -29,52 +29,52 @@ Example valid plugin config:
`; `;
exports[`sortConfig sorts route config correctly 1`] = ` exports[`sortConfig sorts route config correctly 1`] = `
Array [ [
Object { {
"component": "", "component": "",
"path": "/community", "path": "/community",
}, },
Object { {
"component": "", "component": "",
"path": "/some-page", "path": "/some-page",
}, },
Object { {
"component": "", "component": "",
"path": "/docs", "path": "/docs",
"routes": Array [ "routes": [
Object { {
"component": "", "component": "",
"path": "/docs/someDoc", "path": "/docs/someDoc",
}, },
Object { {
"component": "", "component": "",
"path": "/docs/someOtherDoc", "path": "/docs/someOtherDoc",
}, },
], ],
}, },
Object { {
"component": "", "component": "",
"path": "/", "path": "/",
}, },
Object { {
"component": "", "component": "",
"path": "/", "path": "/",
"routes": Array [ "routes": [
Object { {
"component": "", "component": "",
"path": "/someDoc", "path": "/someDoc",
}, },
Object { {
"component": "", "component": "",
"path": "/someOtherDoc", "path": "/someOtherDoc",
}, },
], ],
}, },
Object { {
"component": "", "component": "",
"path": "/", "path": "/",
"routes": Array [ "routes": [
Object { {
"component": "", "component": "",
"path": "/subroute", "path": "/subroute",
}, },
@ -84,42 +84,42 @@ Array [
`; `;
exports[`sortConfig sorts route config given a baseURL 1`] = ` exports[`sortConfig sorts route config given a baseURL 1`] = `
Array [ [
Object { {
"component": "", "component": "",
"path": "/latest/community", "path": "/latest/community",
}, },
Object { {
"component": "", "component": "",
"path": "/latest/example", "path": "/latest/example",
}, },
Object { {
"component": "", "component": "",
"path": "/latest/some-page", "path": "/latest/some-page",
}, },
Object { {
"component": "", "component": "",
"path": "/latest/docs", "path": "/latest/docs",
"routes": Array [ "routes": [
Object { {
"component": "", "component": "",
"path": "/latest/docs/someDoc", "path": "/latest/docs/someDoc",
}, },
Object { {
"component": "", "component": "",
"path": "/latest/docs/someOtherDoc", "path": "/latest/docs/someOtherDoc",
}, },
], ],
}, },
Object { {
"component": "", "component": "",
"path": "/latest", "path": "/latest",
"routes": Array [ "routes": [
Object { {
"component": "", "component": "",
"path": "/latest/someDoc", "path": "/latest/someDoc",
}, },
Object { {
"component": "", "component": "",
"path": "/latest/someOtherDoc", "path": "/latest/someOtherDoc",
}, },

View file

@ -1,121 +1,121 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`loadPresets array form 1`] = ` exports[`loadPresets array form 1`] = `
Object { {
"plugins": Array [ "plugins": [
Array [ [
"@docusaurus/plugin-content-docs", "@docusaurus/plugin-content-docs",
undefined, undefined,
], ],
Array [ [
"@docusaurus/plugin-content-blog", "@docusaurus/plugin-content-blog",
undefined, undefined,
], ],
], ],
"themes": Array [], "themes": [],
} }
`; `;
exports[`loadPresets array form composite 1`] = ` exports[`loadPresets array form composite 1`] = `
Object { {
"plugins": Array [ "plugins": [
Array [ [
"@docusaurus/plugin-content-docs", "@docusaurus/plugin-content-docs",
Object { {
"path": "../", "path": "../",
}, },
], ],
Array [ [
"@docusaurus/plugin-content-blog", "@docusaurus/plugin-content-blog",
undefined, undefined,
], ],
Array [ [
"@docusaurus/plugin-content-pages", "@docusaurus/plugin-content-pages",
Object { {
"path": "../", "path": "../",
}, },
], ],
Array [ [
"@docusaurus/plugin-sitemap", "@docusaurus/plugin-sitemap",
undefined, undefined,
], ],
], ],
"themes": Array [], "themes": [],
} }
`; `;
exports[`loadPresets array form with options 1`] = ` exports[`loadPresets array form with options 1`] = `
Object { {
"plugins": Array [ "plugins": [
Array [ [
"@docusaurus/plugin-content-docs", "@docusaurus/plugin-content-docs",
Object { {
"path": "../", "path": "../",
}, },
], ],
Array [ [
"@docusaurus/plugin-content-blog", "@docusaurus/plugin-content-blog",
undefined, undefined,
], ],
], ],
"themes": Array [], "themes": [],
} }
`; `;
exports[`loadPresets mixed form 1`] = ` exports[`loadPresets mixed form 1`] = `
Object { {
"plugins": Array [ "plugins": [
Array [ [
"@docusaurus/plugin-content-docs", "@docusaurus/plugin-content-docs",
Object { {
"path": "../", "path": "../",
}, },
], ],
Array [ [
"@docusaurus/plugin-content-blog", "@docusaurus/plugin-content-blog",
undefined, undefined,
], ],
Array [ [
"@docusaurus/plugin-content-pages", "@docusaurus/plugin-content-pages",
undefined, undefined,
], ],
Array [ [
"@docusaurus/plugin-sitemap", "@docusaurus/plugin-sitemap",
undefined, undefined,
], ],
], ],
"themes": Array [], "themes": [],
} }
`; `;
exports[`loadPresets mixed form with themes 1`] = ` exports[`loadPresets mixed form with themes 1`] = `
Object { {
"plugins": Array [ "plugins": [
Array [ [
"@docusaurus/plugin-content-docs", "@docusaurus/plugin-content-docs",
Object { {
"path": "../", "path": "../",
}, },
], ],
Array [ [
"@docusaurus/plugin-content-blog", "@docusaurus/plugin-content-blog",
undefined, undefined,
], ],
Array [ [
"@docusaurus/plugin-content-pages", "@docusaurus/plugin-content-pages",
undefined, undefined,
], ],
Array [ [
"@docusaurus/plugin-sitemap", "@docusaurus/plugin-sitemap",
undefined, undefined,
], ],
Array [ [
"@docusaurus/plugin-test", "@docusaurus/plugin-test",
undefined, undefined,
], ],
], ],
"themes": Array [ "themes": [
Array [ [
"@docusaurus/theme-classic", "@docusaurus/theme-classic",
undefined, undefined,
], ],
@ -124,41 +124,41 @@ Object {
`; `;
exports[`loadPresets string form 1`] = ` exports[`loadPresets string form 1`] = `
Object { {
"plugins": Array [ "plugins": [
Array [ [
"@docusaurus/plugin-content-docs", "@docusaurus/plugin-content-docs",
undefined, undefined,
], ],
Array [ [
"@docusaurus/plugin-content-blog", "@docusaurus/plugin-content-blog",
undefined, undefined,
], ],
], ],
"themes": Array [], "themes": [],
} }
`; `;
exports[`loadPresets string form composite 1`] = ` exports[`loadPresets string form composite 1`] = `
Object { {
"plugins": Array [ "plugins": [
Array [ [
"@docusaurus/plugin-content-docs", "@docusaurus/plugin-content-docs",
undefined, undefined,
], ],
Array [ [
"@docusaurus/plugin-content-blog", "@docusaurus/plugin-content-blog",
undefined, undefined,
], ],
Array [ [
"@docusaurus/plugin-content-pages", "@docusaurus/plugin-content-pages",
undefined, undefined,
], ],
Array [ [
"@docusaurus/plugin-sitemap", "@docusaurus/plugin-sitemap",
undefined, undefined,
], ],
], ],
"themes": Array [], "themes": [],
} }
`; `;

View file

@ -20,9 +20,9 @@ describe('loadPresets', () => {
} as LoadContext; } as LoadContext;
const presets = await loadPresets(context); const presets = await loadPresets(context);
expect(presets).toMatchInlineSnapshot(` expect(presets).toMatchInlineSnapshot(`
Object { {
"plugins": Array [], "plugins": [],
"themes": Array [], "themes": [],
} }
`); `);
}); });

View file

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`base webpack config creates webpack aliases 1`] = ` exports[`base webpack config creates webpack aliases 1`] = `
Object { {
"@docusaurus/BrowserOnly": "../../../../client/exports/BrowserOnly.tsx", "@docusaurus/BrowserOnly": "../../../../client/exports/BrowserOnly.tsx",
"@docusaurus/ComponentCreator": "../../../../client/exports/ComponentCreator.tsx", "@docusaurus/ComponentCreator": "../../../../client/exports/ComponentCreator.tsx",
"@docusaurus/ErrorBoundary": "../../../../client/exports/ErrorBoundary.tsx", "@docusaurus/ErrorBoundary": "../../../../client/exports/ErrorBoundary.tsx",
@ -48,7 +48,7 @@ Object {
`; `;
exports[`getDocusaurusAliases() returns appropriate webpack aliases 1`] = ` exports[`getDocusaurusAliases() returns appropriate webpack aliases 1`] = `
Object { {
"@docusaurus/BrowserOnly": "../../client/exports/BrowserOnly.tsx", "@docusaurus/BrowserOnly": "../../client/exports/BrowserOnly.tsx",
"@docusaurus/ComponentCreator": "../../client/exports/ComponentCreator.tsx", "@docusaurus/ComponentCreator": "../../client/exports/ComponentCreator.tsx",
"@docusaurus/ErrorBoundary": "../../client/exports/ErrorBoundary.tsx", "@docusaurus/ErrorBoundary": "../../client/exports/ErrorBoundary.tsx",