diff --git a/jest.config.mjs b/jest.config.mjs index 2b0342501b..c469fed92f 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -25,13 +25,14 @@ const ignorePatterns = [ export default { rootDir: fileURLToPath(new URL('.', import.meta.url)), verbose: true, - testURL: 'http://localhost/', + testURL: 'https://docusaurus.io/', testEnvironment: 'node', testPathIgnorePatterns: ignorePatterns, coveragePathIgnorePatterns: ignorePatterns, transform: { '^.+\\.[jt]sx?$': 'babel-jest', }, + errorOnDeprecated: true, moduleNameMapper: { // Jest can't resolve CSS or asset imports '^.+\\.(css|jpe?g|png|svg)$': '/jest/emptyModule.js', @@ -49,10 +50,8 @@ export default { '@docusaurus/plugin-content-docs/client': '@docusaurus/plugin-content-docs/src/client/index.ts', }, - globals: { - window: { - location: {href: 'https://docusaurus.io'}, - }, - }, snapshotSerializers: ['/jest/snapshotPathNormalizer.js'], + snapshotFormat: { + printBasicPrototype: false, + }, }; diff --git a/packages/docusaurus-logger/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-logger/src/__tests__/__snapshots__/index.test.ts.snap index 27685bfd37..cf55c3083a 100644 --- a/packages/docusaurus-logger/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-logger/src/__tests__/__snapshots__/index.test.ts.snap @@ -1,68 +1,68 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`error prints objects 1`] = ` -Array [ - Array [ +[ + [ "[ERROR] {\\"a\\":1}", ], - Array [ + [ "[ERROR] undefined", ], - Array [ + [ "[ERROR] 1,2,3", ], - Array [ + [ "[ERROR] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)", ], ] `; exports[`info prints objects 1`] = ` -Array [ - Array [ +[ + [ "[INFO] {\\"a\\":1}", ], - Array [ + [ "[INFO] undefined", ], - Array [ + [ "[INFO] 1,2,3", ], - Array [ + [ "[INFO] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)", ], ] `; exports[`success prints objects 1`] = ` -Array [ - Array [ +[ + [ "[SUCCESS] {\\"a\\":1}", ], - Array [ + [ "[SUCCESS] undefined", ], - Array [ + [ "[SUCCESS] 1,2,3", ], - Array [ + [ "[SUCCESS] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)", ], ] `; exports[`warn prints objects 1`] = ` -Array [ - Array [ +[ + [ "[WARNING] {\\"a\\":1}", ], - Array [ + [ "[WARNING] undefined", ], - Array [ + [ "[WARNING] 1,2,3", ], - Array [ + [ "[WARNING] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)", ], ] diff --git a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__snapshots__/index.test.ts.snap index d7b84a9350..35011f30c9 100644 --- a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__snapshots__/index.test.ts.snap @@ -96,19 +96,19 @@ cmd /C 'set \\"GIT_USER=\\" && yarn deploy' `; exports[`unwrapMdxCodeBlocks remark plugin unwraps the mdx code blocks AST 1`] = ` -Object { - "children": Array [ - Object { - "children": Array [ - Object { +{ + "children": [ + { + "children": [ + { "position": Position { - "end": Object { + "end": { "column": 32, "line": 1, "offset": 31, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 3, "line": 1, "offset": 2, @@ -120,13 +120,13 @@ Object { ], "depth": 1, "position": Position { - "end": Object { + "end": { "column": 32, "line": 1, "offset": 31, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 1, "offset": 0, @@ -134,17 +134,17 @@ Object { }, "type": "heading", }, - Object { - "children": Array [ - Object { + { + "children": [ + { "position": Position { - "end": Object { + "end": { "column": 23, "line": 3, "offset": 55, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 4, "line": 3, "offset": 36, @@ -156,13 +156,13 @@ Object { ], "depth": 2, "position": Position { - "end": Object { + "end": { "column": 23, "line": 3, "offset": 55, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 3, "offset": 33, @@ -170,17 +170,17 @@ Object { }, "type": "heading", }, - Object { - "children": Array [ - Object { + { + "children": [ + { "position": Position { - "end": Object { + "end": { "column": 5, "line": 5, "offset": 61, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 5, "offset": 57, @@ -191,13 +191,13 @@ Object { }, ], "position": Position { - "end": Object { + "end": { "column": 5, "line": 5, "offset": 61, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 5, "offset": 57, @@ -205,19 +205,19 @@ Object { }, "type": "paragraph", }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { + { + "children": [ + { + "children": [ + { "position": Position { - "end": Object { + "end": { "column": 6, "line": 7, "offset": 68, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 2, "line": 7, "offset": 64, @@ -228,13 +228,13 @@ Object { }, ], "position": Position { - "end": Object { + "end": { "column": 29, "line": 7, "offset": 91, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 7, "offset": 63, @@ -246,13 +246,13 @@ Object { }, ], "position": Position { - "end": Object { + "end": { "column": 29, "line": 7, "offset": 91, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 7, "offset": 63, @@ -260,19 +260,19 @@ Object { }, "type": "paragraph", }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { + { + "children": [ + { + "children": [ + { "position": Position { - "end": Object { + "end": { "column": 7, "line": 9, "offset": 99, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 3, "line": 9, "offset": 95, @@ -283,13 +283,13 @@ Object { }, ], "position": Position { - "end": Object { + "end": { "column": 9, "line": 9, "offset": 101, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 9, "offset": 93, @@ -299,13 +299,13 @@ Object { }, ], "position": Position { - "end": Object { + "end": { "column": 9, "line": 9, "offset": 101, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 9, "offset": 93, @@ -313,18 +313,18 @@ Object { }, "type": "paragraph", }, - Object { - "children": Array [ - Object { + { + "children": [ + { "alt": "image", "position": Position { - "end": Object { + "end": { "column": 43, "line": 11, "offset": 145, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 11, "offset": 103, @@ -336,13 +336,13 @@ Object { }, ], "position": Position { - "end": Object { + "end": { "column": 43, "line": 11, "offset": 145, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 11, "offset": 103, @@ -350,17 +350,17 @@ Object { }, "type": "paragraph", }, - Object { - "children": Array [ - Object { + { + "children": [ + { "position": Position { - "end": Object { + "end": { "column": 18, "line": 13, "offset": 164, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 4, "line": 13, "offset": 150, @@ -372,13 +372,13 @@ Object { ], "depth": 2, "position": Position { - "end": Object { + "end": { "column": 18, "line": 13, "offset": 164, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 13, "offset": 147, @@ -386,15 +386,15 @@ Object { }, "type": "heading", }, - Object { + { "position": Position { - "end": Object { + "end": { "column": 23, "line": 15, "offset": 188, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 15, "offset": 166, @@ -403,18 +403,18 @@ Object { "type": "import", "value": "import XYZ from 'xyz';", }, - Object { + { "position": Position { - "end": Object { + "end": { "column": 7, "line": 19, "offset": 287, }, - "indent": Array [ + "indent": [ 1, 1, ], - "start": Object { + "start": { "column": 1, "line": 17, "offset": 190, @@ -425,17 +425,17 @@ Object { Test ", }, - Object { - "children": Array [ - Object { + { + "children": [ + { "position": Position { - "end": Object { + "end": { "column": 29, "line": 21, "offset": 317, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 4, "line": 21, "offset": 292, @@ -447,13 +447,13 @@ Object { ], "depth": 2, "position": Position { - "end": Object { + "end": { "column": 29, "line": 21, "offset": 317, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 21, "offset": 289, @@ -461,16 +461,16 @@ Object { }, "type": "heading", }, - Object { + { "lang": "mdx-code-block", "meta": null, "position": Position { - "end": Object { + "end": { "column": 4, "line": 29, "offset": 442, }, - "indent": Array [ + "indent": [ 1, 1, 1, @@ -478,7 +478,7 @@ Object { 1, 1, ], - "start": Object { + "start": { "column": 1, "line": 23, "offset": 319, @@ -491,17 +491,17 @@ Object {
Sebastien Lorber
", }, - Object { - "children": Array [ - Object { + { + "children": [ + { "position": Position { - "end": Object { + "end": { "column": 44, "line": 31, "offset": 487, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 4, "line": 31, "offset": 447, @@ -513,13 +513,13 @@ Object { ], "depth": 2, "position": Position { - "end": Object { + "end": { "column": 44, "line": 31, "offset": 487, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 31, "offset": 444, @@ -527,14 +527,14 @@ Object { }, "type": "heading", }, - Object { + { "position": Position { - "end": Object { + "end": { "column": 25, "line": 40, "offset": 688, }, - "indent": Array [ + "indent": [ 1, 1, 1, @@ -543,7 +543,7 @@ Object { 1, 1, ], - "start": Object { + "start": { "column": 1, "line": 33, "offset": 489, @@ -559,20 +559,20 @@ Object { ]}> ", }, - Object { + { "lang": "bash", "meta": null, "position": Position { - "end": Object { + "end": { "column": 4, "line": 44, "offset": 740, }, - "indent": Array [ + "indent": [ 1, 1, ], - "start": Object { + "start": { "column": 1, "line": 42, "offset": 690, @@ -581,17 +581,17 @@ Object { "type": "code", "value": "GIT_USER= yarn deploy", }, - Object { + { "position": Position { - "end": Object { + "end": { "column": 28, "line": 47, "offset": 782, }, - "indent": Array [ + "indent": [ 1, ], - "start": Object { + "start": { "column": 1, "line": 46, "offset": 742, @@ -601,20 +601,20 @@ Object { "value": " ", }, - Object { + { "lang": null, "meta": null, "position": Position { - "end": Object { + "end": { "column": 8, "line": 51, "offset": 865, }, - "indent": Array [ + "indent": [ 1, 1, ], - "start": Object { + "start": { "column": 1, "line": 49, "offset": 784, @@ -625,17 +625,17 @@ Object { cmd /C \\"set \\"GIT_USER=\\" && yarn deploy\\" \`\`\`", }, - Object { + { "position": Position { - "end": Object { + "end": { "column": 31, "line": 54, "offset": 910, }, - "indent": Array [ + "indent": [ 1, ], - "start": Object { + "start": { "column": 1, "line": 53, "offset": 867, @@ -645,20 +645,20 @@ cmd /C \\"set \\"GIT_USER=\\" && yarn deploy\\" "value": " ", }, - Object { + { "lang": "powershell", "meta": null, "position": Position { - "end": Object { + "end": { "column": 4, "line": 58, "offset": 986, }, - "indent": Array [ + "indent": [ 1, 1, ], - "start": Object { + "start": { "column": 1, "line": 56, "offset": 912, @@ -667,17 +667,17 @@ cmd /C \\"set \\"GIT_USER=\\" && yarn deploy\\" "type": "code", "value": "cmd /C 'set \\"GIT_USER=\\" && yarn deploy'", }, - Object { + { "position": Position { - "end": Object { + "end": { "column": 8, "line": 61, "offset": 1008, }, - "indent": Array [ + "indent": [ 1, ], - "start": Object { + "start": { "column": 1, "line": 60, "offset": 988, @@ -687,17 +687,17 @@ cmd /C \\"set \\"GIT_USER=\\" && yarn deploy\\" "value": " ", }, - Object { - "children": Array [ - Object { + { + "children": [ + { "position": Position { - "end": Object { + "end": { "column": 55, "line": 63, "offset": 1064, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 4, "line": 63, "offset": 1013, @@ -709,13 +709,13 @@ cmd /C \\"set \\"GIT_USER=\\" && yarn deploy\\" ], "depth": 2, "position": Position { - "end": Object { + "end": { "column": 55, "line": 63, "offset": 1064, }, - "indent": Array [], - "start": Object { + "indent": [], + "start": { "column": 1, "line": 63, "offset": 1010, @@ -723,16 +723,16 @@ cmd /C \\"set \\"GIT_USER=\\" && yarn deploy\\" }, "type": "heading", }, - Object { + { "lang": "mdx-code-block", "meta": null, "position": Position { - "end": Object { + "end": { "column": 5, "line": 95, "offset": 1585, }, - "indent": Array [ + "indent": [ 1, 1, 1, @@ -764,7 +764,7 @@ cmd /C \\"set \\"GIT_USER=\\" && yarn deploy\\" 1, 1, ], - "start": Object { + "start": { "column": 1, "line": 65, "offset": 1066, @@ -802,13 +802,13 @@ cmd /C 'set \\"GIT_USER=\\" && yarn deploy' ", }, ], - "position": Object { - "end": Object { + "position": { + "end": { "column": 1, "line": 96, "offset": 1586, }, - "start": Object { + "start": { "column": 1, "line": 1, "offset": 0, diff --git a/packages/docusaurus-migrate/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-migrate/src/__tests__/__snapshots__/index.test.ts.snap index 750f8e7e95..6bb29e50da 100644 --- a/packages/docusaurus-migrate/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-migrate/src/__tests__/__snapshots__/index.test.ts.snap @@ -1,16 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`migration CLI migrates complex website: copy 1`] = ` -Array [ - Array [ +[ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/blog", "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/blog", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/pages/en", "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/src/pages", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/static", "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/static", ], @@ -18,18 +18,18 @@ Array [ `; exports[`migration CLI migrates complex website: mkdirp 1`] = ` -Array [ - Array [ +[ + [ "/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`] = ` -Array [ - Array [ +[ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/docusaurus.config.js", "module.exports={ \\"title\\": \\"Docusaurus\\", @@ -138,7 +138,7 @@ Array [ } }", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/package.json", "{ \\"name\\": \\"docusaurus-1-website\\", @@ -167,7 +167,7 @@ Array [ } }", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/src/css/customTheme.css", ":root{ --ifm-color-primary-lightest: #3CAD6E; @@ -184,16 +184,16 @@ Array [ `; exports[`migration CLI migrates missing versions: copy 1`] = ` -Array [ - Array [ +[ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/blog", "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/blog", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/pages/en", "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/src/pages", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/static", "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/static", ], @@ -201,18 +201,18 @@ Array [ `; exports[`migration CLI migrates missing versions: mkdirp 1`] = ` -Array [ - Array [ +[ + [ "/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`] = ` -Array [ - Array [ +[ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/docusaurus.config.js", "module.exports={ \\"title\\": \\"Docusaurus\\", @@ -321,7 +321,7 @@ Array [ } }", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/package.json", "{ \\"name\\": \\"docusaurus-1-website\\", @@ -350,7 +350,7 @@ Array [ } }", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/src/css/customTheme.css", ":root{ --ifm-color-primary-lightest: #3CAD6E; @@ -367,12 +367,12 @@ Array [ `; exports[`migration CLI migrates simple website: copy 1`] = ` -Array [ - Array [ +[ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/pages/en", "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/src/pages", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/static", "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/static", ], @@ -380,18 +380,18 @@ Array [ `; exports[`migration CLI migrates simple website: mkdirp 1`] = ` -Array [ - Array [ +[ + [ "/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`] = ` -Array [ - Array [ +[ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/docusaurus.config.js", "module.exports={ \\"title\\": \\"Docusaurus\\", @@ -501,7 +501,7 @@ Array [ } }", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/package.json", "{ \\"name\\": \\"docusaurus-1-website\\", @@ -530,7 +530,7 @@ Array [ } }", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/src/css/customTheme.css", ":root{ --ifm-color-primary-lightest: #3CAD6E; @@ -543,7 +543,7 @@ Array [ } ", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/docs/api-commands.md", "--- id: commands @@ -552,7 +552,7 @@ title: CLI Commands ## Doc ", ], - Array [ + [ "/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/docs/api-doc-markdown.md", "--- id: doc-markdown diff --git a/packages/docusaurus-plugin-client-redirects/src/__tests__/__snapshots__/writeRedirectFiles.test.ts.snap b/packages/docusaurus-plugin-client-redirects/src/__tests__/__snapshots__/writeRedirectFiles.test.ts.snap index acdc68104e..fa9472e3b1 100644 --- a/packages/docusaurus-plugin-client-redirects/src/__tests__/__snapshots__/writeRedirectFiles.test.ts.snap +++ b/packages/docusaurus-plugin-client-redirects/src/__tests__/__snapshots__/writeRedirectFiles.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`toRedirectFilesMetadata creates appropriate metadata for empty baseUrl: fileContent baseUrl=empty 1`] = ` -Array [ +[ " @@ -17,7 +17,7 @@ Array [ `; exports[`toRedirectFilesMetadata creates appropriate metadata for root baseUrl: fileContent baseUrl=/ 1`] = ` -Array [ +[ " @@ -33,7 +33,7 @@ Array [ `; exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=false: fileContent 1`] = ` -Array [ +[ " @@ -71,7 +71,7 @@ Array [ `; exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=true: fileContent 1`] = ` -Array [ +[ " @@ -109,7 +109,7 @@ Array [ `; exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=undefined: fileContent 1`] = ` -Array [ +[ " diff --git a/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/feed.test.ts.snap b/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/feed.test.ts.snap index f44f9a7105..ec932459f4 100644 --- a/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/feed.test.ts.snap +++ b/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/feed.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`atom has feed item for each post 1`] = ` -Array [ +[ " https://docusaurus.io/myBaseUrl/blog @@ -85,7 +85,7 @@ Array [ `; exports[`json has feed item for each post 1`] = ` -Array [ +[ "{ \\"version\\": \\"https://jsonfeed.org/version/1\\", \\"title\\": \\"Hello Blog\\", @@ -172,7 +172,7 @@ Array [ `; exports[`rss has feed item for each post 1`] = ` -Array [ +[ " diff --git a/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/index.test.ts.snap index 37ba6bf0d0..473ed4d5bd 100644 --- a/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/index.test.ts.snap @@ -1,22 +1,22 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`blog plugin works on blog tags without pagination 1`] = ` -Object { - "/blog/tags/tag-1": Object { - "items": Array [ +{ + "/blog/tags/tag-1": { + "items": [ "/simple/slug/another", "/another/tags", "/another/tags2", ], "name": "tag1", - "pages": Array [ - Object { - "items": Array [ + "pages": [ + { + "items": [ "/simple/slug/another", "/another/tags", "/another/tags2", ], - "metadata": Object { + "metadata": { "blogDescription": "Blog", "blogTitle": "Blog", "nextPage": null, @@ -31,19 +31,19 @@ Object { ], "permalink": "/blog/tags/tag-1", }, - "/blog/tags/tag-2": Object { - "items": Array [ + "/blog/tags/tag-2": { + "items": [ "/another/tags", "/another/tags2", ], "name": "tag2", - "pages": Array [ - Object { - "items": Array [ + "pages": [ + { + "items": [ "/another/tags", "/another/tags2", ], - "metadata": Object { + "metadata": { "blogDescription": "Blog", "blogTitle": "Blog", "nextPage": null, @@ -62,21 +62,21 @@ Object { `; exports[`blog plugin works with blog tags 1`] = ` -Object { - "/blog/tags/tag-1": Object { - "items": Array [ +{ + "/blog/tags/tag-1": { + "items": [ "/simple/slug/another", "/another/tags", "/another/tags2", ], "name": "tag1", - "pages": Array [ - Object { - "items": Array [ + "pages": [ + { + "items": [ "/simple/slug/another", "/another/tags", ], - "metadata": Object { + "metadata": { "blogDescription": "Blog", "blogTitle": "Blog", "nextPage": "/blog/tags/tag-1/page/2", @@ -88,11 +88,11 @@ Object { "totalPages": 2, }, }, - Object { - "items": Array [ + { + "items": [ "/another/tags2", ], - "metadata": Object { + "metadata": { "blogDescription": "Blog", "blogTitle": "Blog", "nextPage": null, @@ -107,19 +107,19 @@ Object { ], "permalink": "/blog/tags/tag-1", }, - "/blog/tags/tag-2": Object { - "items": Array [ + "/blog/tags/tag-2": { + "items": [ "/another/tags", "/another/tags2", ], "name": "tag2", - "pages": Array [ - Object { - "items": Array [ + "pages": [ + { + "items": [ "/another/tags", "/another/tags2", ], - "metadata": Object { + "metadata": { "blogDescription": "Blog", "blogTitle": "Blog", "nextPage": null, diff --git a/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/translations.test.ts.snap b/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/translations.test.ts.snap index 9e97fbbe83..e07e327f88 100644 --- a/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/translations.test.ts.snap +++ b/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/translations.test.ts.snap @@ -1,18 +1,18 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`getContentTranslationFiles returns translation files matching snapshot 1`] = ` -Array [ - Object { - "content": Object { - "description": Object { +[ + { + "content": { + "description": { "description": "The description for the blog used in SEO", "message": "Someone's random blog", }, - "sidebar.title": Object { + "sidebar.title": { "description": "The label for the left sidebar", "message": "All my posts", }, - "title": Object { + "title": { "description": "The title for the blog used in SEO", "message": "My blog", }, @@ -23,13 +23,13 @@ Array [ `; exports[`translateContent falls back when translation is incomplete 1`] = ` -Object { - "blogListPaginated": Array [ - Object { - "items": Array [ +{ + "blogListPaginated": [ + { + "items": [ "hello", ], - "metadata": Object { + "metadata": { "blogDescription": "Someone's random blog", "blogTitle": "My blog", "nextPage": null, @@ -42,35 +42,35 @@ Object { }, }, ], - "blogPosts": Array [ - Object { + "blogPosts": [ + { "id": "hello", - "metadata": Object { + "metadata": { "date": 2021-07-19T00:00:00.000Z, "description": "/blog/2021/06/19/hello", "formattedDate": "June 19, 2021", "permalink": "/blog/2021/06/19/hello", "source": "/blog/2021/06/19/hello", - "tags": Array [], + "tags": [], "title": "Hello", "truncated": true, }, }, ], "blogSidebarTitle": "All my posts", - "blogTags": Object {}, + "blogTags": {}, "blogTagsListPath": "/tags", } `; exports[`translateContent returns translated loaded 1`] = ` -Object { - "blogListPaginated": Array [ - Object { - "items": Array [ +{ + "blogListPaginated": [ + { + "items": [ "hello", ], - "metadata": Object { + "metadata": { "blogDescription": "Someone's random blog (translated)", "blogTitle": "My blog (translated)", "nextPage": null, @@ -83,23 +83,23 @@ Object { }, }, ], - "blogPosts": Array [ - Object { + "blogPosts": [ + { "id": "hello", - "metadata": Object { + "metadata": { "date": 2021-07-19T00:00:00.000Z, "description": "/blog/2021/06/19/hello", "formattedDate": "June 19, 2021", "permalink": "/blog/2021/06/19/hello", "source": "/blog/2021/06/19/hello", - "tags": Array [], + "tags": [], "title": "Hello", "truncated": true, }, }, ], "blogSidebarTitle": "All my posts (translated)", - "blogTags": Object {}, + "blogTags": {}, "blogTagsListPath": "/tags", } `; diff --git a/packages/docusaurus-plugin-content-blog/src/__tests__/index.test.ts b/packages/docusaurus-plugin-content-blog/src/__tests__/index.test.ts index 0dca4dfbb4..2a6d9d24f7 100644 --- a/packages/docusaurus-plugin-content-blog/src/__tests__/index.test.ts +++ b/packages/docusaurus-plugin-content-blog/src/__tests__/index.test.ts @@ -411,11 +411,14 @@ describe('blog plugin', () => { }); 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 blogPosts = await getBlogPosts(siteDir); expect(blogPosts.find((v) => v.metadata.title === 'draft')).toBeUndefined(); + process.env = originalEnv; }); it('creates blog post without date', async () => { diff --git a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/cli.test.ts.snap b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/cli.test.ts.snap index 5536e5ca09..2f4d4e94fa 100644 --- a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/cli.test.ts.snap +++ b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/cli.test.ts.snap @@ -1,43 +1,43 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`docsVersion first time versioning 1`] = ` -Object { - "docs": Object { - "Guides": Array [ +{ + "docs": { + "Guides": [ "hello", ], - "Test": Array [ - Object { - "items": Array [ + "Test": [ + { + "items": [ "foo/bar", "foo/baz", ], "label": "foo", "type": "category", }, - Object { - "items": Array [ + { + "items": [ "rootAbsoluteSlug", "rootRelativeSlug", "rootResolvedSlug", "rootTryToEscapeSlug", ], "label": "Slugs", - "link": Object { + "link": { "type": "generated-index", }, "type": "category", }, - Object { + { "id": "headingAsTitle", "type": "doc", }, - Object { + { "href": "https://github.com", "label": "Github", "type": "link", }, - Object { + { "id": "hello", "type": "ref", }, @@ -47,12 +47,12 @@ Object { `; exports[`docsVersion not the first time versioning 1`] = ` -Object { - "docs": Object { - "Guides": Array [ +{ + "docs": { + "Guides": [ "hello", ], - "Test": Array [ + "Test": [ "foo/bar", ], }, @@ -60,8 +60,8 @@ Object { `; exports[`docsVersion second docs instance versioning 1`] = ` -Object { - "community": Array [ +{ + "community": [ "team", ], } diff --git a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/docs.test.ts.snap b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/docs.test.ts.snap index b66f4a4929..eaed1c90bb 100644 --- a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/docs.test.ts.snap +++ b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/docs.test.ts.snap @@ -1,177 +1,177 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`simple site custom pagination 1`] = ` -Object { - "pagination": Array [ - Object { +{ + "pagination": [ + { "id": "doc with space", - "next": Object { + "next": { "permalink": "/docs/foo/bar", "title": "Bar", }, "prev": undefined, }, - Object { + { "id": "foo/bar", "next": undefined, "prev": undefined, }, - Object { + { "id": "foo/baz", - "next": Object { + "next": { "permalink": "/docs/headingAsTitle", "title": "My heading as title", }, - "prev": Object { + "prev": { "permalink": "/docs/foo/bar", "title": "Bar", }, }, - Object { + { "id": "headingAsTitle", - "next": Object { + "next": { "permalink": "/docs/", "title": "Hello sidebar_label", }, - "prev": Object { + "prev": { "permalink": "/docs/foo/bazSlug.html", "title": "baz pagination_label", }, }, - Object { + { "id": "hello", - "next": Object { + "next": { "permalink": "/docs/ipsum", "title": "ipsum", }, - "prev": Object { + "prev": { "permalink": "/docs/headingAsTitle", "title": "My heading as title", }, }, - Object { + { "id": "ipsum", - "next": Object { + "next": { "permalink": "/docs/lorem", "title": "lorem", }, - "prev": Object { + "prev": { "permalink": "/docs/", "title": "Hello sidebar_label", }, }, - Object { + { "id": "lorem", - "next": Object { + "next": { "permalink": "/docs/rootAbsoluteSlug", "title": "rootAbsoluteSlug", }, - "prev": Object { + "prev": { "permalink": "/docs/ipsum", "title": "ipsum", }, }, - Object { + { "id": "rootAbsoluteSlug", - "next": Object { + "next": { "permalink": "/docs/headingAsTitle", "title": "My heading as title", }, - "prev": Object { + "prev": { "permalink": "/docs/foo/bazSlug.html", "title": "baz pagination_label", }, }, - Object { + { "id": "rootRelativeSlug", - "next": Object { + "next": { "permalink": "/docs/headingAsTitle", "title": "My heading as title", }, - "prev": Object { + "prev": { "permalink": "/docs/foo/bazSlug.html", "title": "baz pagination_label", }, }, - Object { + { "id": "rootResolvedSlug", - "next": Object { + "next": { "permalink": "/docs/headingAsTitle", "title": "My heading as title", }, - "prev": Object { + "prev": { "permalink": "/docs/foo/bazSlug.html", "title": "baz pagination_label", }, }, - Object { + { "id": "rootTryToEscapeSlug", - "next": Object { + "next": { "permalink": "/docs/headingAsTitle", "title": "My heading as title", }, - "prev": Object { + "prev": { "permalink": "/docs/foo/bazSlug.html", "title": "baz pagination_label", }, }, - Object { + { "id": "slugs/absoluteSlug", - "next": Object { + "next": { "permalink": "/docs/slugs/relativeSlug", "title": "relativeSlug", }, - "prev": Object { + "prev": { "permalink": "/docs/rootTryToEscapeSlug", "title": "rootTryToEscapeSlug", }, }, - Object { + { "id": "slugs/relativeSlug", - "next": Object { + "next": { "permalink": "/docs/slugs/hey/resolvedSlug", "title": "resolvedSlug", }, - "prev": Object { + "prev": { "permalink": "/docs/absoluteSlug", "title": "absoluteSlug", }, }, - Object { + { "id": "slugs/resolvedSlug", - "next": Object { + "next": { "permalink": "/docs/tryToEscapeSlug", "title": "tryToEscapeSlug", }, - "prev": Object { + "prev": { "permalink": "/docs/slugs/relativeSlug", "title": "relativeSlug", }, }, - Object { + { "id": "slugs/tryToEscapeSlug", "next": undefined, - "prev": Object { + "prev": { "permalink": "/docs/slugs/hey/resolvedSlug", "title": "resolvedSlug", }, }, ], - "sidebars": Object { - "defaultSidebar": Array [ - Object { + "sidebars": { + "defaultSidebar": [ + { "id": "doc with space", "type": "doc", }, - Object { + { "collapsed": false, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "foo/bar", "type": "doc", }, - Object { + { "id": "foo/baz", "type": "doc", }, @@ -180,56 +180,56 @@ Object { "link": undefined, "type": "category", }, - Object { + { "id": "headingAsTitle", "type": "doc", }, - Object { + { "id": "hello", "label": "Hello sidebar_label", "type": "doc", }, - Object { + { "id": "ipsum", "type": "doc", }, - Object { + { "id": "lorem", "type": "doc", }, - Object { + { "id": "rootAbsoluteSlug", "type": "doc", }, - Object { + { "id": "rootRelativeSlug", "type": "doc", }, - Object { + { "id": "rootResolvedSlug", "type": "doc", }, - Object { + { "id": "rootTryToEscapeSlug", "type": "doc", }, - Object { + { "collapsed": false, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "slugs/absoluteSlug", "type": "doc", }, - Object { + { "id": "slugs/relativeSlug", "type": "doc", }, - Object { + { "id": "slugs/resolvedSlug", "type": "doc", }, - Object { + { "id": "slugs/tryToEscapeSlug", "type": "doc", }, diff --git a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/globalData.test.ts.snap b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/globalData.test.ts.snap index 95ed78b3ff..a646e0241e 100644 --- a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/globalData.test.ts.snap +++ b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/globalData.test.ts.snap @@ -1,19 +1,19 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`toGlobalDataVersion generates the right docs, sidebars, and metadata 1`] = ` -Object { - "docs": Array [ - Object { +{ + "docs": [ + { "id": "main", "path": "/current/main", "sidebar": "tutorial", }, - Object { + { "id": "doc", "path": "/current/doc", "sidebar": "tutorial", }, - Object { + { "id": "/current/generated", "path": "/current/generated", "sidebar": "tutorial", @@ -24,16 +24,16 @@ Object { "mainDocId": "main", "name": "current", "path": "/current", - "sidebars": Object { - "another": Object { - "link": Object { + "sidebars": { + "another": { + "link": { "label": "Generated", "path": "/current/generated", }, }, - "links": Object {}, - "tutorial": Object { - "link": Object { + "links": {}, + "tutorial": { + "link": { "label": "main", "path": "/current/main", }, diff --git a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/index.test.ts.snap index 11e6478de7..b65e9956e3 100644 --- a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/index.test.ts.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`sidebar site with undefined sidebar 1`] = ` -Object { - "defaultSidebar": Array [ - Object { +{ + "defaultSidebar": [ + { "id": "hello-1", "type": "doc", }, - Object { + { "id": "hello-2", "label": "Hello 2 From Doc", "type": "doc", @@ -40,18 +40,18 @@ Available document ids are: `; exports[`simple website content 1`] = ` -Object { +{ "description": "Images", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "id": "baz", "pagination_label": "baz pagination_label", "slug": "bazSlug.html", - "tags": Array [ + "tags": [ "tag 1", "tag-1", - Object { + { "label": "tag 2", "permalink": "tag2-custom-permalink", }, @@ -61,12 +61,12 @@ Object { "id": "foo/baz", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/category/slugs", "title": "Slugs", }, "permalink": "/docs/foo/bazSlug.html", - "previous": Object { + "previous": { "permalink": "/docs/foo/bar", "title": "Bar", }, @@ -75,12 +75,12 @@ Object { "slug": "/foo/bazSlug.html", "source": "@site/docs/foo/baz.md", "sourceDirName": "foo", - "tags": Array [ - Object { + "tags": [ + { "label": "tag 1", "permalink": "/docs/tags/tag-1", }, - Object { + { "label": "tag 2", "permalink": "/docs/tags/tag2-custom-permalink", }, @@ -92,15 +92,15 @@ Object { `; exports[`simple website content 2`] = ` -Object { +{ "description": "Hi, Endilie here :)", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "id": "hello", "sidebar_label": "Hello sidebar_label", "slug": "/", - "tags": Array [ + "tags": [ "tag-1", "tag 3", ], @@ -111,7 +111,7 @@ Object { "lastUpdatedBy": undefined, "next": undefined, "permalink": "/docs/", - "previous": Object { + "previous": { "permalink": "/docs/headingAsTitle", "title": "My heading as title", }, @@ -120,12 +120,12 @@ Object { "slug": "/", "source": "@site/docs/hello.md", "sourceDirName": ".", - "tags": Array [ - Object { + "tags": [ + { "label": "tag-1", "permalink": "/docs/tags/tag-1", }, - Object { + { "label": "tag 3", "permalink": "/docs/tags/tag-3", }, @@ -137,11 +137,11 @@ Object { `; exports[`simple website content 3`] = ` -Object { +{ "description": "This is custom description", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "description": "This is custom description", "id": "bar", "pagination_next": null, @@ -159,7 +159,7 @@ Object { "slug": "/foo/bar", "source": "@site/docs/foo/bar.md", "sourceDirName": "foo", - "tags": Array [], + "tags": [], "title": "Bar", "unversionedId": "foo/bar", "version": "current", @@ -167,21 +167,21 @@ Object { `; exports[`simple website content 4`] = ` -Object { - "docs": Array [ - Object { +{ + "docs": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "foo/bar", "type": "doc", }, - Object { + { "id": "foo/baz", "type": "doc", }, @@ -190,45 +190,45 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "rootAbsoluteSlug", "type": "doc", }, - Object { + { "id": "rootRelativeSlug", "type": "doc", }, - Object { + { "id": "rootResolvedSlug", "type": "doc", }, - Object { + { "id": "rootTryToEscapeSlug", "type": "doc", }, ], "label": "Slugs", - "link": Object { + "link": { "permalink": "/docs/category/slugs", "slug": "/category/slugs", "type": "generated-index", }, "type": "category", }, - Object { + { "id": "headingAsTitle", "type": "doc", }, - Object { + { "href": "https://github.com", "label": "Github", "type": "link", }, - Object { + { "id": "hello", "type": "ref", }, @@ -237,11 +237,11 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "hello", "type": "doc", }, @@ -255,90 +255,90 @@ Object { `; exports[`simple website content 5`] = ` -Object { - "pluginName": Object { - "pluginId": Object { +{ + "pluginName": { + "pluginId": { "breadcrumbs": true, "path": "/docs", - "versions": Array [ - Object { - "docs": Array [ - Object { + "versions": [ + { + "docs": [ + { "id": "doc with space", "path": "/docs/doc with space", "sidebar": undefined, }, - Object { + { "id": "foo/bar", "path": "/docs/foo/bar", "sidebar": "docs", }, - Object { + { "id": "foo/baz", "path": "/docs/foo/bazSlug.html", "sidebar": "docs", }, - Object { + { "id": "headingAsTitle", "path": "/docs/headingAsTitle", "sidebar": "docs", }, - Object { + { "id": "hello", "path": "/docs/", "sidebar": "docs", }, - Object { + { "id": "ipsum", "path": "/docs/ipsum", "sidebar": undefined, }, - Object { + { "id": "lorem", "path": "/docs/lorem", "sidebar": undefined, }, - Object { + { "id": "rootAbsoluteSlug", "path": "/docs/rootAbsoluteSlug", "sidebar": "docs", }, - Object { + { "id": "rootRelativeSlug", "path": "/docs/rootRelativeSlug", "sidebar": "docs", }, - Object { + { "id": "rootResolvedSlug", "path": "/docs/hey/rootResolvedSlug", "sidebar": "docs", }, - Object { + { "id": "rootTryToEscapeSlug", "path": "/docs/rootTryToEscapeSlug", "sidebar": "docs", }, - Object { + { "id": "slugs/absoluteSlug", "path": "/docs/absoluteSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/relativeSlug", "path": "/docs/slugs/relativeSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/resolvedSlug", "path": "/docs/slugs/hey/resolvedSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/tryToEscapeSlug", "path": "/docs/tryToEscapeSlug", "sidebar": undefined, }, - Object { + { "id": "/category/slugs", "path": "/docs/category/slugs", "sidebar": "docs", @@ -349,9 +349,9 @@ Object { "mainDocId": "hello", "name": "current", "path": "/docs", - "sidebars": Object { - "docs": Object { - "link": Object { + "sidebars": { + "docs": { + "link": { "label": "foo/bar", "path": "/docs/foo/bar", }, @@ -365,7 +365,7 @@ Object { `; exports[`simple website content: data 1`] = ` -Object { +{ "category-docs-docs-category-slugs-0fe.json": "{ \\"title\\": \\"Slugs\\", \\"slug\\": \\"/category/slugs\\", @@ -969,90 +969,90 @@ Object { `; exports[`simple website content: global data 1`] = ` -Object { - "pluginName": Object { - "pluginId": Object { +{ + "pluginName": { + "pluginId": { "breadcrumbs": true, "path": "/docs", - "versions": Array [ - Object { - "docs": Array [ - Object { + "versions": [ + { + "docs": [ + { "id": "doc with space", "path": "/docs/doc with space", "sidebar": undefined, }, - Object { + { "id": "foo/bar", "path": "/docs/foo/bar", "sidebar": "docs", }, - Object { + { "id": "foo/baz", "path": "/docs/foo/bazSlug.html", "sidebar": "docs", }, - Object { + { "id": "headingAsTitle", "path": "/docs/headingAsTitle", "sidebar": "docs", }, - Object { + { "id": "hello", "path": "/docs/", "sidebar": "docs", }, - Object { + { "id": "ipsum", "path": "/docs/ipsum", "sidebar": undefined, }, - Object { + { "id": "lorem", "path": "/docs/lorem", "sidebar": undefined, }, - Object { + { "id": "rootAbsoluteSlug", "path": "/docs/rootAbsoluteSlug", "sidebar": "docs", }, - Object { + { "id": "rootRelativeSlug", "path": "/docs/rootRelativeSlug", "sidebar": "docs", }, - Object { + { "id": "rootResolvedSlug", "path": "/docs/hey/rootResolvedSlug", "sidebar": "docs", }, - Object { + { "id": "rootTryToEscapeSlug", "path": "/docs/rootTryToEscapeSlug", "sidebar": "docs", }, - Object { + { "id": "slugs/absoluteSlug", "path": "/docs/absoluteSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/relativeSlug", "path": "/docs/slugs/relativeSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/resolvedSlug", "path": "/docs/slugs/hey/resolvedSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/tryToEscapeSlug", "path": "/docs/tryToEscapeSlug", "sidebar": undefined, }, - Object { + { "id": "/category/slugs", "path": "/docs/category/slugs", "sidebar": "docs", @@ -1063,9 +1063,9 @@ Object { "mainDocId": "hello", "name": "current", "path": "/docs", - "sidebars": Object { - "docs": Object { - "link": Object { + "sidebars": { + "docs": { + "link": { "label": "foo/bar", "path": "/docs/foo/bar", }, @@ -1079,181 +1079,181 @@ Object { `; exports[`simple website content: route config 1`] = ` -Array [ - Object { +[ + { "component": "@theme/DocTagsListPage", "exact": true, - "modules": Object { + "modules": { "tags": "~docs/tags-list-current-prop-15a.json", }, "path": "/docs/tags", }, - Object { + { "component": "@theme/DocTagDocListPage", "exact": true, - "modules": Object { + "modules": { "tag": "~docs/tag-docs-tags-tag-1-b3f.json", }, "path": "/docs/tags/tag-1", }, - Object { + { "component": "@theme/DocTagDocListPage", "exact": true, - "modules": Object { + "modules": { "tag": "~docs/tag-docs-tags-tag-3-ab5.json", }, "path": "/docs/tags/tag-3", }, - Object { + { "component": "@theme/DocTagDocListPage", "exact": true, - "modules": Object { + "modules": { "tag": "~docs/tag-docs-tags-tag-2-custom-permalink-825.json", }, "path": "/docs/tags/tag2-custom-permalink", }, - Object { + { "component": "@theme/DocPage", "exact": false, - "modules": Object { + "modules": { "versionMetadata": "~docs/version-current-metadata-prop-751.json", }, "path": "/docs", "priority": -1, - "routes": Array [ - Object { + "routes": [ + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/hello.md", }, "path": "/docs/", "sidebar": "docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/slugs/absoluteSlug.md", }, "path": "/docs/absoluteSlug", }, - Object { + { "component": "@theme/DocCategoryGeneratedIndexPage", "exact": true, - "modules": Object { + "modules": { "categoryGeneratedIndex": "~docs/category-docs-docs-category-slugs-0fe.json", }, "path": "/docs/category/slugs", "sidebar": "docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/doc with space.md", }, "path": "/docs/doc with space", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/foo/bar.md", }, "path": "/docs/foo/bar", "sidebar": "docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/foo/baz.md", }, "path": "/docs/foo/bazSlug.html", "sidebar": "docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/headingAsTitle.md", }, "path": "/docs/headingAsTitle", "sidebar": "docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/rootResolvedSlug.md", }, "path": "/docs/hey/rootResolvedSlug", "sidebar": "docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/ipsum.md", }, "path": "/docs/ipsum", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/lorem.md", }, "path": "/docs/lorem", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/rootAbsoluteSlug.md", }, "path": "/docs/rootAbsoluteSlug", "sidebar": "docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/rootRelativeSlug.md", }, "path": "/docs/rootRelativeSlug", "sidebar": "docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/rootTryToEscapeSlug.md", }, "path": "/docs/rootTryToEscapeSlug", "sidebar": "docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/slugs/resolvedSlug.md", }, "path": "/docs/slugs/hey/resolvedSlug", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/slugs/relativeSlug.md", }, "path": "/docs/slugs/relativeSlug", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/slugs/tryToEscapeSlug.md", }, "path": "/docs/tryToEscapeSlug", @@ -1264,7 +1264,7 @@ Array [ `; exports[`simple website getPathToWatch 1`] = ` -Array [ +[ "sidebars.json", "i18n/en/docusaurus-plugin-content-docs/current/**/*.{md,mdx}", "docs/**/*.{md,mdx}", @@ -1273,13 +1273,13 @@ Array [ `; exports[`site with custom sidebar items generator sidebar is autogenerated according to a custom sidebarItemsGenerator 1`] = ` -Object { - "defaultSidebar": Array [ - Object { +{ + "defaultSidebar": [ + { "id": "API/api-overview", "type": "doc", }, - Object { + { "id": "API/api-end", "type": "doc", }, @@ -1288,25 +1288,25 @@ Object { `; exports[`site with custom sidebar items generator sidebarItemsGenerator can wrap/enhance/sort/reverse the default sidebar generator 1`] = ` -Object { - "defaultSidebar": Array [ - Object { +{ + "defaultSidebar": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "API/api-end", "type": "doc", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "API/Extension APIs/Theme API", "type": "doc", }, - Object { + { "id": "API/Extension APIs/Plugin API", "type": "doc", }, @@ -1315,15 +1315,15 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "API/Core APIs/Server API", "type": "doc", }, - Object { + { "id": "API/Core APIs/Client API", "type": "doc", }, @@ -1332,7 +1332,7 @@ Object { "link": undefined, "type": "category", }, - Object { + { "id": "API/api-overview", "type": "doc", }, @@ -1341,31 +1341,31 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "Guides/guide5", "type": "doc", }, - Object { + { "id": "Guides/guide4", "type": "doc", }, - Object { + { "id": "Guides/guide3", "type": "doc", }, - Object { + { "id": "Guides/guide2.5", "type": "doc", }, - Object { + { "id": "Guides/guide2", "type": "doc", }, - Object { + { "id": "Guides/guide1", "type": "doc", }, @@ -1374,11 +1374,11 @@ Object { "link": undefined, "type": "category", }, - Object { + { "id": "installation", "type": "doc", }, - Object { + { "id": "getting-started", "type": "doc", }, @@ -1387,70 +1387,70 @@ Object { `; exports[`site with custom sidebar items generator sidebarItemsGenerator is called with appropriate data 1`] = ` -Object { - "categoriesMetadata": Object { - "3-API": Object { +{ + "categoriesMetadata": { + "3-API": { "label": "API (label from _category_.json)", }, - "3-API/02_Extension APIs": Object { + "3-API/02_Extension APIs": { "label": "Extension APIs (label from _category_.yml)", }, - "Guides": Object { + "Guides": { "position": 2, }, }, "defaultSidebarItemsGenerator": [Function], - "docs": Array [ - Object { - "frontMatter": Object {}, + "docs": [ + { + "frontMatter": {}, "id": "API/Core APIs/Client API", "sidebarPosition": 0, "source": "@site/docs/3-API/01_Core APIs/0 --- Client API.md", "sourceDirName": "3-API/01_Core APIs", "unversionedId": "API/Core APIs/Client API", }, - Object { - "frontMatter": Object {}, + { + "frontMatter": {}, "id": "API/Core APIs/Server API", "sidebarPosition": 1, "source": "@site/docs/3-API/01_Core APIs/1 --- Server API.md", "sourceDirName": "3-API/01_Core APIs", "unversionedId": "API/Core APIs/Server API", }, - Object { - "frontMatter": Object {}, + { + "frontMatter": {}, "id": "API/Extension APIs/Plugin API", "sidebarPosition": 0, "source": "@site/docs/3-API/02_Extension APIs/0. Plugin API.md", "sourceDirName": "3-API/02_Extension APIs", "unversionedId": "API/Extension APIs/Plugin API", }, - Object { - "frontMatter": Object {}, + { + "frontMatter": {}, "id": "API/Extension APIs/Theme API", "sidebarPosition": 1, "source": "@site/docs/3-API/02_Extension APIs/1. Theme API.md", "sourceDirName": "3-API/02_Extension APIs", "unversionedId": "API/Extension APIs/Theme API", }, - Object { - "frontMatter": Object {}, + { + "frontMatter": {}, "id": "API/api-end", "sidebarPosition": 3, "source": "@site/docs/3-API/03_api-end.md", "sourceDirName": "3-API", "unversionedId": "API/api-end", }, - Object { - "frontMatter": Object {}, + { + "frontMatter": {}, "id": "API/api-overview", "sidebarPosition": 0, "source": "@site/docs/3-API/00_api-overview.md", "sourceDirName": "3-API", "unversionedId": "API/api-overview", }, - Object { - "frontMatter": Object { + { + "frontMatter": { "id": "guide1", "sidebar_position": 1, }, @@ -1460,8 +1460,8 @@ Object { "sourceDirName": "Guides", "unversionedId": "Guides/guide1", }, - Object { - "frontMatter": Object { + { + "frontMatter": { "id": "guide2", }, "id": "Guides/guide2", @@ -1470,8 +1470,8 @@ Object { "sourceDirName": "Guides", "unversionedId": "Guides/guide2", }, - Object { - "frontMatter": Object { + { + "frontMatter": { "id": "guide2.5", "sidebar_position": 2.5, }, @@ -1481,8 +1481,8 @@ Object { "sourceDirName": "Guides", "unversionedId": "Guides/guide2.5", }, - Object { - "frontMatter": Object { + { + "frontMatter": { "id": "guide3", "sidebar_position": 3, }, @@ -1492,8 +1492,8 @@ Object { "sourceDirName": "Guides", "unversionedId": "Guides/guide3", }, - Object { - "frontMatter": Object { + { + "frontMatter": { "id": "guide4", }, "id": "Guides/guide4", @@ -1502,8 +1502,8 @@ Object { "sourceDirName": "Guides", "unversionedId": "Guides/guide4", }, - Object { - "frontMatter": Object { + { + "frontMatter": { "id": "guide5", }, "id": "Guides/guide5", @@ -1512,16 +1512,16 @@ Object { "sourceDirName": "Guides", "unversionedId": "Guides/guide5", }, - Object { - "frontMatter": Object {}, + { + "frontMatter": {}, "id": "getting-started", "sidebarPosition": 0, "source": "@site/docs/0-getting-started.md", "sourceDirName": ".", "unversionedId": "getting-started", }, - Object { - "frontMatter": Object {}, + { + "frontMatter": {}, "id": "installation", "sidebarPosition": 1, "source": "@site/docs/1-installation.md", @@ -1530,16 +1530,16 @@ Object { }, ], "isCategoryIndex": [Function], - "item": Object { + "item": { "dirName": ".", "type": "autogenerated", }, "numberPrefixParser": [Function], - "options": Object { + "options": { "sidebarCollapsed": true, "sidebarCollapsible": true, }, - "version": Object { + "version": { "contentPath": "docs", "versionName": "current", }, @@ -1547,15 +1547,15 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 1`] = ` -Object { +{ "description": "Getting started text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "getting-started", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/installation", "title": "Installation", }, @@ -1566,7 +1566,7 @@ Object { "slug": "/getting-started", "source": "@site/docs/0-getting-started.md", "sourceDirName": ".", - "tags": Array [], + "tags": [], "title": "Getting Started", "unversionedId": "getting-started", "version": "current", @@ -1574,20 +1574,20 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 2`] = ` -Object { +{ "description": "Installation text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "installation", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/Guides/guide1", "title": "Guide 1", }, "permalink": "/docs/installation", - "previous": Object { + "previous": { "permalink": "/docs/getting-started", "title": "Getting Started", }, @@ -1596,7 +1596,7 @@ Object { "slug": "/installation", "source": "@site/docs/1-installation.md", "sourceDirName": ".", - "tags": Array [], + "tags": [], "title": "Installation", "unversionedId": "installation", "version": "current", @@ -1604,23 +1604,23 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 3`] = ` -Object { +{ "description": "Guide 1 text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "id": "guide1", "sidebar_position": 1, }, "id": "Guides/guide1", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/Guides/guide2", "title": "Guide 2", }, "permalink": "/docs/Guides/guide1", - "previous": Object { + "previous": { "permalink": "/docs/installation", "title": "Installation", }, @@ -1629,7 +1629,7 @@ Object { "slug": "/Guides/guide1", "source": "@site/docs/Guides/z-guide1.md", "sourceDirName": "Guides", - "tags": Array [], + "tags": [], "title": "Guide 1", "unversionedId": "Guides/guide1", "version": "current", @@ -1637,22 +1637,22 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 4`] = ` -Object { +{ "description": "Guide 2 text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "id": "guide2", }, "id": "Guides/guide2", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/Guides/guide2.5", "title": "Guide 2.5", }, "permalink": "/docs/Guides/guide2", - "previous": Object { + "previous": { "permalink": "/docs/Guides/guide1", "title": "Guide 1", }, @@ -1661,7 +1661,7 @@ Object { "slug": "/Guides/guide2", "source": "@site/docs/Guides/02-guide2.md", "sourceDirName": "Guides", - "tags": Array [], + "tags": [], "title": "Guide 2", "unversionedId": "Guides/guide2", "version": "current", @@ -1669,23 +1669,23 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 5`] = ` -Object { +{ "description": "Guide 2.5 text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "id": "guide2.5", "sidebar_position": 2.5, }, "id": "Guides/guide2.5", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/Guides/guide3", "title": "Guide 3", }, "permalink": "/docs/Guides/guide2.5", - "previous": Object { + "previous": { "permalink": "/docs/Guides/guide2", "title": "Guide 2", }, @@ -1694,7 +1694,7 @@ Object { "slug": "/Guides/guide2.5", "source": "@site/docs/Guides/0-guide2.5.md", "sourceDirName": "Guides", - "tags": Array [], + "tags": [], "title": "Guide 2.5", "unversionedId": "Guides/guide2.5", "version": "current", @@ -1702,23 +1702,23 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 6`] = ` -Object { +{ "description": "Guide 3 text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "id": "guide3", "sidebar_position": 3, }, "id": "Guides/guide3", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/Guides/guide4", "title": "Guide 4", }, "permalink": "/docs/Guides/guide3", - "previous": Object { + "previous": { "permalink": "/docs/Guides/guide2.5", "title": "Guide 2.5", }, @@ -1727,7 +1727,7 @@ Object { "slug": "/Guides/guide3", "source": "@site/docs/Guides/guide3.md", "sourceDirName": "Guides", - "tags": Array [], + "tags": [], "title": "Guide 3", "unversionedId": "Guides/guide3", "version": "current", @@ -1735,22 +1735,22 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 7`] = ` -Object { +{ "description": "Guide 4 text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "id": "guide4", }, "id": "Guides/guide4", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/Guides/guide5", "title": "Guide 5", }, "permalink": "/docs/Guides/guide4", - "previous": Object { + "previous": { "permalink": "/docs/Guides/guide3", "title": "Guide 3", }, @@ -1759,7 +1759,7 @@ Object { "slug": "/Guides/guide4", "source": "@site/docs/Guides/a-guide4.md", "sourceDirName": "Guides", - "tags": Array [], + "tags": [], "title": "Guide 4", "unversionedId": "Guides/guide4", "version": "current", @@ -1767,22 +1767,22 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 8`] = ` -Object { +{ "description": "Guide 5 text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "id": "guide5", }, "id": "Guides/guide5", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/API/api-overview", "title": "API Overview", }, "permalink": "/docs/Guides/guide5", - "previous": Object { + "previous": { "permalink": "/docs/Guides/guide4", "title": "Guide 4", }, @@ -1791,7 +1791,7 @@ Object { "slug": "/Guides/guide5", "source": "@site/docs/Guides/b-guide5.md", "sourceDirName": "Guides", - "tags": Array [], + "tags": [], "title": "Guide 5", "unversionedId": "Guides/guide5", "version": "current", @@ -1799,20 +1799,20 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 9`] = ` -Object { +{ "description": "API Overview text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "API/api-overview", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/API/Core APIs/Client API", "title": "Client API", }, "permalink": "/docs/API/api-overview", - "previous": Object { + "previous": { "permalink": "/docs/Guides/guide5", "title": "Guide 5", }, @@ -1821,7 +1821,7 @@ Object { "slug": "/API/api-overview", "source": "@site/docs/3-API/00_api-overview.md", "sourceDirName": "3-API", - "tags": Array [], + "tags": [], "title": "API Overview", "unversionedId": "API/api-overview", "version": "current", @@ -1829,20 +1829,20 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 10`] = ` -Object { +{ "description": "Client API text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "API/Core APIs/Client API", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/API/Core APIs/Server API", "title": "Server API", }, "permalink": "/docs/API/Core APIs/Client API", - "previous": Object { + "previous": { "permalink": "/docs/API/api-overview", "title": "API Overview", }, @@ -1851,7 +1851,7 @@ Object { "slug": "/API/Core APIs/Client API", "source": "@site/docs/3-API/01_Core APIs/0 --- Client API.md", "sourceDirName": "3-API/01_Core APIs", - "tags": Array [], + "tags": [], "title": "Client API", "unversionedId": "API/Core APIs/Client API", "version": "current", @@ -1859,20 +1859,20 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 11`] = ` -Object { +{ "description": "Server API text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "API/Core APIs/Server API", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/API/Extension APIs/Plugin API", "title": "Plugin API", }, "permalink": "/docs/API/Core APIs/Server API", - "previous": Object { + "previous": { "permalink": "/docs/API/Core APIs/Client API", "title": "Client API", }, @@ -1881,7 +1881,7 @@ Object { "slug": "/API/Core APIs/Server API", "source": "@site/docs/3-API/01_Core APIs/1 --- Server API.md", "sourceDirName": "3-API/01_Core APIs", - "tags": Array [], + "tags": [], "title": "Server API", "unversionedId": "API/Core APIs/Server API", "version": "current", @@ -1889,20 +1889,20 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 12`] = ` -Object { +{ "description": "Plugin API text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "API/Extension APIs/Plugin API", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/API/Extension APIs/Theme API", "title": "Theme API", }, "permalink": "/docs/API/Extension APIs/Plugin API", - "previous": Object { + "previous": { "permalink": "/docs/API/Core APIs/Server API", "title": "Server API", }, @@ -1911,7 +1911,7 @@ Object { "slug": "/API/Extension APIs/Plugin API", "source": "@site/docs/3-API/02_Extension APIs/0. Plugin API.md", "sourceDirName": "3-API/02_Extension APIs", - "tags": Array [], + "tags": [], "title": "Plugin API", "unversionedId": "API/Extension APIs/Plugin API", "version": "current", @@ -1919,20 +1919,20 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 13`] = ` -Object { +{ "description": "Theme API text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "API/Extension APIs/Theme API", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/API/api-end", "title": "API End", }, "permalink": "/docs/API/Extension APIs/Theme API", - "previous": Object { + "previous": { "permalink": "/docs/API/Extension APIs/Plugin API", "title": "Plugin API", }, @@ -1941,7 +1941,7 @@ Object { "slug": "/API/Extension APIs/Theme API", "source": "@site/docs/3-API/02_Extension APIs/1. Theme API.md", "sourceDirName": "3-API/02_Extension APIs", - "tags": Array [], + "tags": [], "title": "Theme API", "unversionedId": "API/Extension APIs/Theme API", "version": "current", @@ -1949,17 +1949,17 @@ Object { `; exports[`site with full autogenerated sidebar docs in fully generated sidebar have correct metadata 14`] = ` -Object { +{ "description": "API End text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "API/api-end", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": undefined, "permalink": "/docs/API/api-end", - "previous": Object { + "previous": { "permalink": "/docs/API/Extension APIs/Theme API", "title": "Theme API", }, @@ -1968,7 +1968,7 @@ Object { "slug": "/API/api-end", "source": "@site/docs/3-API/03_api-end.md", "sourceDirName": "3-API", - "tags": Array [], + "tags": [], "title": "API End", "unversionedId": "API/api-end", "version": "current", @@ -1976,41 +1976,41 @@ Object { `; exports[`site with full autogenerated sidebar sidebar is fully autogenerated 1`] = ` -Object { - "defaultSidebar": Array [ - Object { +{ + "defaultSidebar": [ + { "id": "getting-started", "type": "doc", }, - Object { + { "id": "installation", "type": "doc", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "Guides/guide1", "type": "doc", }, - Object { + { "id": "Guides/guide2", "type": "doc", }, - Object { + { "id": "Guides/guide2.5", "type": "doc", }, - Object { + { "id": "Guides/guide3", "type": "doc", }, - Object { + { "id": "Guides/guide4", "type": "doc", }, - Object { + { "id": "Guides/guide5", "type": "doc", }, @@ -2019,23 +2019,23 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "API/api-overview", "type": "doc", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "API/Core APIs/Client API", "type": "doc", }, - Object { + { "id": "API/Core APIs/Server API", "type": "doc", }, @@ -2044,15 +2044,15 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "API/Extension APIs/Plugin API", "type": "doc", }, - Object { + { "id": "API/Extension APIs/Theme API", "type": "doc", }, @@ -2061,7 +2061,7 @@ Object { "link": undefined, "type": "category", }, - Object { + { "id": "API/api-end", "type": "doc", }, @@ -2075,25 +2075,25 @@ Object { `; exports[`site with partial autogenerated sidebars 2 (fix #4638) sidebar is partially autogenerated 1`] = ` -Object { - "someSidebar": Array [ - Object { +{ + "someSidebar": [ + { "id": "API/api-end", "type": "doc", }, - Object { + { "id": "API/api-overview", "type": "doc", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "API/Core APIs/Client API", "type": "doc", }, - Object { + { "id": "API/Core APIs/Server API", "type": "doc", }, @@ -2102,15 +2102,15 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "API/Extension APIs/Plugin API", "type": "doc", }, - Object { + { "id": "API/Extension APIs/Theme API", "type": "doc", }, @@ -2119,7 +2119,7 @@ Object { "link": undefined, "type": "category", }, - Object { + { "id": "API/api-end", "type": "doc", }, @@ -2128,15 +2128,15 @@ Object { `; exports[`site with partial autogenerated sidebars docs in partially generated sidebar have correct metadata 1`] = ` -Object { +{ "description": "API End text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "API/api-end", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/API/api-overview", "title": "API Overview", }, @@ -2147,7 +2147,7 @@ Object { "slug": "/API/api-end", "source": "@site/docs/3-API/03_api-end.md", "sourceDirName": "3-API", - "tags": Array [], + "tags": [], "title": "API End", "unversionedId": "API/api-end", "version": "current", @@ -2155,20 +2155,20 @@ Object { `; exports[`site with partial autogenerated sidebars docs in partially generated sidebar have correct metadata 2`] = ` -Object { +{ "description": "API Overview text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "API/api-overview", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/API/Extension APIs/Plugin API", "title": "Plugin API", }, "permalink": "/docs/API/api-overview", - "previous": Object { + "previous": { "permalink": "/docs/API/api-end", "title": "API End", }, @@ -2177,7 +2177,7 @@ Object { "slug": "/API/api-overview", "source": "@site/docs/3-API/00_api-overview.md", "sourceDirName": "3-API", - "tags": Array [], + "tags": [], "title": "API Overview", "unversionedId": "API/api-overview", "version": "current", @@ -2185,20 +2185,20 @@ Object { `; exports[`site with partial autogenerated sidebars docs in partially generated sidebar have correct metadata 3`] = ` -Object { +{ "description": "Plugin API text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "API/Extension APIs/Plugin API", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/API/Extension APIs/Theme API", "title": "Theme API", }, "permalink": "/docs/API/Extension APIs/Plugin API", - "previous": Object { + "previous": { "permalink": "/docs/API/api-overview", "title": "API Overview", }, @@ -2207,7 +2207,7 @@ Object { "slug": "/API/Extension APIs/Plugin API", "source": "@site/docs/3-API/02_Extension APIs/0. Plugin API.md", "sourceDirName": "3-API/02_Extension APIs", - "tags": Array [], + "tags": [], "title": "Plugin API", "unversionedId": "API/Extension APIs/Plugin API", "version": "current", @@ -2215,17 +2215,17 @@ Object { `; exports[`site with partial autogenerated sidebars docs in partially generated sidebar have correct metadata 4`] = ` -Object { +{ "description": "Theme API text", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "API/Extension APIs/Theme API", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": undefined, "permalink": "/docs/API/Extension APIs/Theme API", - "previous": Object { + "previous": { "permalink": "/docs/API/Extension APIs/Plugin API", "title": "Plugin API", }, @@ -2234,7 +2234,7 @@ Object { "slug": "/API/Extension APIs/Theme API", "source": "@site/docs/3-API/02_Extension APIs/1. Theme API.md", "sourceDirName": "3-API/02_Extension APIs", - "tags": Array [], + "tags": [], "title": "Theme API", "unversionedId": "API/Extension APIs/Theme API", "version": "current", @@ -2242,25 +2242,25 @@ Object { `; exports[`site with partial autogenerated sidebars sidebar is partially autogenerated 1`] = ` -Object { - "someSidebar": Array [ - Object { +{ + "someSidebar": [ + { "id": "API/api-end", "type": "doc", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "API/api-overview", "type": "doc", }, - Object { + { "id": "API/Extension APIs/Plugin API", "type": "doc", }, - Object { + { "id": "API/Extension APIs/Theme API", "type": "doc", }, @@ -2274,11 +2274,11 @@ Object { `; exports[`versioned website (community) content 1`] = ` -Object { +{ "description": "Team current version (translated)", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "title": "Team title translated", }, "id": "team", @@ -2292,7 +2292,7 @@ Object { "slug": "/team", "source": "@site/i18n/en/docusaurus-plugin-content-docs-community/current/team.md", "sourceDirName": ".", - "tags": Array [], + "tags": [], "title": "Team title translated", "unversionedId": "team", "version": "current", @@ -2300,11 +2300,11 @@ Object { `; exports[`versioned website (community) content 2`] = ` -Object { +{ "description": "Team 1.0.0", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "version-1.0.0/team", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, @@ -2316,7 +2316,7 @@ Object { "slug": "/team", "source": "@site/community_versioned_docs/version-1.0.0/team.md", "sourceDirName": ".", - "tags": Array [], + "tags": [], "title": "team", "unversionedId": "team", "version": "1.0.0", @@ -2324,9 +2324,9 @@ Object { `; exports[`versioned website (community) content: 100 version sidebars 1`] = ` -Object { - "version-1.0.0/community": Array [ - Object { +{ + "version-1.0.0/community": [ + { "id": "version-1.0.0/team", "type": "doc", }, @@ -2335,9 +2335,9 @@ Object { `; exports[`versioned website (community) content: current version sidebars 1`] = ` -Object { - "community": Array [ - Object { +{ + "community": [ + { "id": "team", "type": "doc", }, @@ -2346,7 +2346,7 @@ Object { `; exports[`versioned website (community) content: data 1`] = ` -Object { +{ "site-community-versioned-docs-version-1-0-0-team-md-359.json": "{ \\"unversionedId\\": \\"team\\", \\"id\\": \\"version-1.0.0/team\\", @@ -2435,15 +2435,15 @@ Object { `; exports[`versioned website (community) content: global data 1`] = ` -Object { - "pluginName": Object { - "pluginId": Object { +{ + "pluginName": { + "pluginId": { "breadcrumbs": true, "path": "/community", - "versions": Array [ - Object { - "docs": Array [ - Object { + "versions": [ + { + "docs": [ + { "id": "team", "path": "/community/next/team", "sidebar": "community", @@ -2454,18 +2454,18 @@ Object { "mainDocId": "team", "name": "current", "path": "/community/next", - "sidebars": Object { - "community": Object { - "link": Object { + "sidebars": { + "community": { + "link": { "label": "team", "path": "/community/next/team", }, }, }, }, - Object { - "docs": Array [ - Object { + { + "docs": [ + { "id": "team", "path": "/community/team", "sidebar": "version-1.0.0/community", @@ -2476,9 +2476,9 @@ Object { "mainDocId": "team", "name": "1.0.0", "path": "/community", - "sidebars": Object { - "version-1.0.0/community": Object { - "link": Object { + "sidebars": { + "version-1.0.0/community": { + "link": { "label": "version-1.0.0/team", "path": "/community/team", }, @@ -2492,20 +2492,20 @@ Object { `; exports[`versioned website (community) content: route config 1`] = ` -Array [ - Object { +[ + { "component": "@theme/DocPage", "exact": false, - "modules": Object { + "modules": { "versionMetadata": "~docs/version-current-metadata-prop-751.json", }, "path": "/community/next", "priority": undefined, - "routes": Array [ - Object { + "routes": [ + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/i18n/en/docusaurus-plugin-content-docs-community/current/team.md", }, "path": "/community/next/team", @@ -2513,19 +2513,19 @@ Array [ }, ], }, - Object { + { "component": "@theme/DocPage", "exact": false, - "modules": Object { + "modules": { "versionMetadata": "~docs/version-1-0-0-metadata-prop-608.json", }, "path": "/community", "priority": -1, - "routes": Array [ - Object { + "routes": [ + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/community_versioned_docs/version-1.0.0/team.md", }, "path": "/community/team", @@ -2537,7 +2537,7 @@ Array [ `; exports[`versioned website (community) getPathToWatch 1`] = ` -Array [ +[ "community_sidebars.json", "i18n/en/docusaurus-plugin-content-docs-community/current/**/*.{md,mdx}", "community/**/*.{md,mdx}", @@ -2550,16 +2550,16 @@ Array [ `; exports[`versioned website content 1`] = ` -Object { +{ "description": "This is next version of bar.", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "slug": "barSlug", - "tags": Array [ + "tags": [ "barTag 1", "barTag-2", - Object { + { "label": "barTag 3", "permalink": "barTag-3-permalink", }, @@ -2568,7 +2568,7 @@ Object { "id": "foo/bar", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/next/", "title": "hello", }, @@ -2579,16 +2579,16 @@ Object { "slug": "/foo/barSlug", "source": "@site/docs/foo/bar.md", "sourceDirName": "foo", - "tags": Array [ - Object { + "tags": [ + { "label": "barTag 1", "permalink": "/docs/next/tags/bar-tag-1", }, - Object { + { "label": "barTag-2", "permalink": "/docs/next/tags/bar-tag-2", }, - Object { + { "label": "barTag 3", "permalink": "/docs/next/tags/barTag-3-permalink", }, @@ -2600,15 +2600,15 @@ Object { `; exports[`versioned website content 2`] = ` -Object { +{ "description": "Bar 1.0.1 !", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "version-1.0.1/foo/bar", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/", "title": "hello", }, @@ -2619,7 +2619,7 @@ Object { "slug": "/foo/bar", "source": "@site/versioned_docs/version-1.0.1/foo/bar.md", "sourceDirName": "foo", - "tags": Array [], + "tags": [], "title": "bar", "unversionedId": "foo/bar", "version": "1.0.1", @@ -2627,11 +2627,11 @@ Object { `; exports[`versioned website content 3`] = ` -Object { +{ "description": "Hello next !", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "slug": "/", }, "id": "hello", @@ -2639,7 +2639,7 @@ Object { "lastUpdatedBy": undefined, "next": undefined, "permalink": "/docs/next/", - "previous": Object { + "previous": { "permalink": "/docs/next/foo/barSlug", "title": "bar", }, @@ -2648,7 +2648,7 @@ Object { "slug": "/", "source": "@site/docs/hello.md", "sourceDirName": ".", - "tags": Array [], + "tags": [], "title": "hello", "unversionedId": "hello", "version": "current", @@ -2656,11 +2656,11 @@ Object { `; exports[`versioned website content 4`] = ` -Object { +{ "description": "Hello 1.0.1 !", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object { + "frontMatter": { "slug": "/", }, "id": "version-1.0.1/hello", @@ -2668,7 +2668,7 @@ Object { "lastUpdatedBy": undefined, "next": undefined, "permalink": "/docs/", - "previous": Object { + "previous": { "permalink": "/docs/foo/bar", "title": "bar", }, @@ -2677,7 +2677,7 @@ Object { "slug": "/", "source": "@site/versioned_docs/version-1.0.1/hello.md", "sourceDirName": ".", - "tags": Array [], + "tags": [], "title": "hello", "unversionedId": "hello", "version": "1.0.1", @@ -2685,20 +2685,20 @@ Object { `; exports[`versioned website content 5`] = ` -Object { +{ "description": "Baz 1.0.0 ! This will be deleted in next subsequent versions.", "editUrl": undefined, "formattedLastUpdatedAt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, "id": "version-1.0.0/foo/baz", "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, - "next": Object { + "next": { "permalink": "/docs/1.0.0/", "title": "hello", }, "permalink": "/docs/1.0.0/foo/baz", - "previous": Object { + "previous": { "permalink": "/docs/1.0.0/foo/barSlug", "title": "bar", }, @@ -2707,7 +2707,7 @@ Object { "slug": "/foo/baz", "source": "@site/versioned_docs/version-1.0.0/foo/baz.md", "sourceDirName": "foo", - "tags": Array [], + "tags": [], "title": "baz", "unversionedId": "foo/baz", "version": "1.0.0", @@ -2715,17 +2715,17 @@ Object { `; exports[`versioned website content: 100 version sidebars 1`] = ` -Object { - "version-1.0.0/docs": Array [ - Object { +{ + "version-1.0.0/docs": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "version-1.0.0/foo/bar", "type": "doc", }, - Object { + { "id": "version-1.0.0/foo/baz", "type": "doc", }, @@ -2734,11 +2734,11 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "version-1.0.0/hello", "type": "doc", }, @@ -2752,13 +2752,13 @@ Object { `; exports[`versioned website content: 101 version sidebars 1`] = ` -Object { - "VersionedSideBarNameDoesNotMatter/docs": Array [ - Object { +{ + "VersionedSideBarNameDoesNotMatter/docs": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "foo/bar", "type": "doc", }, @@ -2767,11 +2767,11 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "version-1.0.1/hello", "type": "doc", }, @@ -2785,13 +2785,13 @@ Object { `; exports[`versioned website content: current version sidebars 1`] = ` -Object { - "docs": Array [ - Object { +{ + "docs": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "foo/bar", "type": "doc", }, @@ -2800,11 +2800,11 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "hello", "type": "doc", }, @@ -2818,7 +2818,7 @@ Object { `; exports[`versioned website content: data 1`] = ` -Object { +{ "site-docs-foo-bar-md-8c2.json": "{ \\"unversionedId\\": \\"foo/bar\\", \\"id\\": \\"foo/bar\\", @@ -3488,40 +3488,40 @@ Object { `; exports[`versioned website content: global data 1`] = ` -Object { - "pluginName": Object { - "pluginId": Object { +{ + "pluginName": { + "pluginId": { "breadcrumbs": true, "path": "/docs", - "versions": Array [ - Object { - "docs": Array [ - Object { + "versions": [ + { + "docs": [ + { "id": "foo/bar", "path": "/docs/next/foo/barSlug", "sidebar": "docs", }, - Object { + { "id": "hello", "path": "/docs/next/", "sidebar": "docs", }, - Object { + { "id": "slugs/absoluteSlug", "path": "/docs/next/absoluteSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/relativeSlug", "path": "/docs/next/slugs/relativeSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/resolvedSlug", "path": "/docs/next/slugs/hey/resolvedSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/tryToEscapeSlug", "path": "/docs/next/tryToEscapeSlug", "sidebar": undefined, @@ -3532,23 +3532,23 @@ Object { "mainDocId": "hello", "name": "current", "path": "/docs/next", - "sidebars": Object { - "docs": Object { - "link": Object { + "sidebars": { + "docs": { + "link": { "label": "foo/bar", "path": "/docs/next/foo/barSlug", }, }, }, }, - Object { - "docs": Array [ - Object { + { + "docs": [ + { "id": "foo/bar", "path": "/docs/foo/bar", "sidebar": "VersionedSideBarNameDoesNotMatter/docs", }, - Object { + { "id": "hello", "path": "/docs/", "sidebar": "VersionedSideBarNameDoesNotMatter/docs", @@ -3559,28 +3559,28 @@ Object { "mainDocId": "hello", "name": "1.0.1", "path": "/docs", - "sidebars": Object { - "VersionedSideBarNameDoesNotMatter/docs": Object { - "link": Object { + "sidebars": { + "VersionedSideBarNameDoesNotMatter/docs": { + "link": { "label": "foo/bar", "path": "/docs/foo/bar", }, }, }, }, - Object { - "docs": Array [ - Object { + { + "docs": [ + { "id": "foo/bar", "path": "/docs/1.0.0/foo/barSlug", "sidebar": "version-1.0.0/docs", }, - Object { + { "id": "foo/baz", "path": "/docs/1.0.0/foo/baz", "sidebar": "version-1.0.0/docs", }, - Object { + { "id": "hello", "path": "/docs/1.0.0/", "sidebar": "version-1.0.0/docs", @@ -3591,53 +3591,53 @@ Object { "mainDocId": "hello", "name": "1.0.0", "path": "/docs/1.0.0", - "sidebars": Object { - "version-1.0.0/docs": Object { - "link": Object { + "sidebars": { + "version-1.0.0/docs": { + "link": { "label": "version-1.0.0/foo/bar", "path": "/docs/1.0.0/foo/barSlug", }, }, }, }, - Object { - "docs": Array [ - Object { + { + "docs": [ + { "id": "rootAbsoluteSlug", "path": "/docs/withSlugs/rootAbsoluteSlug", "sidebar": "version-1.0.1/docs", }, - Object { + { "id": "rootRelativeSlug", "path": "/docs/withSlugs/rootRelativeSlug", "sidebar": undefined, }, - Object { + { "id": "rootResolvedSlug", "path": "/docs/withSlugs/hey/rootResolvedSlug", "sidebar": undefined, }, - Object { + { "id": "rootTryToEscapeSlug", "path": "/docs/withSlugs/rootTryToEscapeSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/absoluteSlug", "path": "/docs/withSlugs/absoluteSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/relativeSlug", "path": "/docs/withSlugs/slugs/relativeSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/resolvedSlug", "path": "/docs/withSlugs/slugs/hey/resolvedSlug", "sidebar": undefined, }, - Object { + { "id": "slugs/tryToEscapeSlug", "path": "/docs/withSlugs/tryToEscapeSlug", "sidebar": undefined, @@ -3648,9 +3648,9 @@ Object { "mainDocId": "rootAbsoluteSlug", "name": "withSlugs", "path": "/docs/withSlugs", - "sidebars": Object { - "version-1.0.1/docs": Object { - "link": Object { + "sidebars": { + "version-1.0.1/docs": { + "link": { "label": "version-withSlugs/rootAbsoluteSlug", "path": "/docs/withSlugs/rootAbsoluteSlug", }, @@ -3664,70 +3664,70 @@ Object { `; exports[`versioned website content: route config 1`] = ` -Array [ - Object { +[ + { "component": "@theme/DocTagsListPage", "exact": true, - "modules": Object { + "modules": { "tags": "~docs/tags-list-current-prop-15a.json", }, "path": "/docs/next/tags", }, - Object { + { "component": "@theme/DocTagDocListPage", "exact": true, - "modules": Object { + "modules": { "tag": "~docs/tag-docs-next-tags-bar-tag-1-a8f.json", }, "path": "/docs/next/tags/bar-tag-1", }, - Object { + { "component": "@theme/DocTagDocListPage", "exact": true, - "modules": Object { + "modules": { "tag": "~docs/tag-docs-next-tags-bar-tag-2-216.json", }, "path": "/docs/next/tags/bar-tag-2", }, - Object { + { "component": "@theme/DocTagDocListPage", "exact": true, - "modules": Object { + "modules": { "tag": "~docs/tag-docs-next-tags-bar-tag-3-permalink-94a.json", }, "path": "/docs/next/tags/barTag-3-permalink", }, - Object { + { "component": "@theme/DocPage", "exact": false, - "modules": Object { + "modules": { "versionMetadata": "~docs/version-1-0-0-metadata-prop-608.json", }, "path": "/docs/1.0.0", "priority": undefined, - "routes": Array [ - Object { + "routes": [ + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md", }, "path": "/docs/1.0.0/", "sidebar": "version-1.0.0/docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-1.0.0/foo/bar.md", }, "path": "/docs/1.0.0/foo/barSlug", "sidebar": "version-1.0.0/docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-1.0.0/foo/baz.md", }, "path": "/docs/1.0.0/foo/baz", @@ -3735,165 +3735,165 @@ Array [ }, ], }, - Object { + { "component": "@theme/DocPage", "exact": false, - "modules": Object { + "modules": { "versionMetadata": "~docs/version-current-metadata-prop-751.json", }, "path": "/docs/next", "priority": undefined, - "routes": Array [ - Object { + "routes": [ + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/hello.md", }, "path": "/docs/next/", "sidebar": "docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/slugs/absoluteSlug.md", }, "path": "/docs/next/absoluteSlug", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/foo/bar.md", }, "path": "/docs/next/foo/barSlug", "sidebar": "docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/slugs/resolvedSlug.md", }, "path": "/docs/next/slugs/hey/resolvedSlug", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/slugs/relativeSlug.md", }, "path": "/docs/next/slugs/relativeSlug", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/docs/slugs/tryToEscapeSlug.md", }, "path": "/docs/next/tryToEscapeSlug", }, ], }, - Object { + { "component": "@theme/DocPage", "exact": false, - "modules": Object { + "modules": { "versionMetadata": "~docs/version-with-slugs-metadata-prop-2bf.json", }, "path": "/docs/withSlugs", "priority": undefined, - "routes": Array [ - Object { + "routes": [ + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-withSlugs/slugs/absoluteSlug.md", }, "path": "/docs/withSlugs/absoluteSlug", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-withSlugs/rootResolvedSlug.md", }, "path": "/docs/withSlugs/hey/rootResolvedSlug", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-withSlugs/rootAbsoluteSlug.md", }, "path": "/docs/withSlugs/rootAbsoluteSlug", "sidebar": "version-1.0.1/docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-withSlugs/rootRelativeSlug.md", }, "path": "/docs/withSlugs/rootRelativeSlug", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-withSlugs/rootTryToEscapeSlug.md", }, "path": "/docs/withSlugs/rootTryToEscapeSlug", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-withSlugs/slugs/resolvedSlug.md", }, "path": "/docs/withSlugs/slugs/hey/resolvedSlug", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-withSlugs/slugs/relativeSlug.md", }, "path": "/docs/withSlugs/slugs/relativeSlug", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-withSlugs/slugs/tryToEscapeSlug.md", }, "path": "/docs/withSlugs/tryToEscapeSlug", }, ], }, - Object { + { "component": "@theme/DocPage", "exact": false, - "modules": Object { + "modules": { "versionMetadata": "~docs/version-1-0-1-metadata-prop-e87.json", }, "path": "/docs", "priority": -1, - "routes": Array [ - Object { + "routes": [ + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-1.0.1/hello.md", }, "path": "/docs/", "sidebar": "VersionedSideBarNameDoesNotMatter/docs", }, - Object { + { "component": "@theme/DocItem", "exact": true, - "modules": Object { + "modules": { "content": "@site/versioned_docs/version-1.0.1/foo/bar.md", }, "path": "/docs/foo/bar", @@ -3905,13 +3905,13 @@ Array [ `; exports[`versioned website content: withSlugs version sidebars 1`] = ` -Object { - "version-1.0.1/docs": Array [ - Object { +{ + "version-1.0.1/docs": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "version-withSlugs/rootAbsoluteSlug", "type": "doc", }, @@ -3925,7 +3925,7 @@ Object { `; exports[`versioned website getPathToWatch 1`] = ` -Array [ +[ "sidebars.json", "i18n/en/docusaurus-plugin-content-docs/current/**/*.{md,mdx}", "docs/**/*.{md,mdx}", diff --git a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/translations.test.ts.snap b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/translations.test.ts.snap index 62fceab793..30c85bc511 100644 --- a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/translations.test.ts.snap +++ b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/translations.test.ts.snap @@ -1,76 +1,76 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`getLoadedContentTranslationFiles returns translation files 1`] = ` -Array [ - Object { - "content": Object { - "sidebar.docs.category.Getting started": Object { +[ + { + "content": { + "sidebar.docs.category.Getting started": { "description": "The label for category Getting started in sidebar docs", "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", "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", "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", "message": "Link label", }, - "version.label": Object { + "version.label": { "description": "The label for version current", "message": "current label", }, }, "path": "current", }, - Object { - "content": Object { - "sidebar.docs.category.Getting started": Object { + { + "content": { + "sidebar.docs.category.Getting started": { "description": "The label for category Getting started in sidebar docs", "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", "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", "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", "message": "Link label", }, - "version.label": Object { + "version.label": { "description": "The label for version 2.0.0", "message": "2.0.0 label", }, }, "path": "version-2.0.0", }, - Object { - "content": Object { - "sidebar.docs.category.Getting started": Object { + { + "content": { + "sidebar.docs.category.Getting started": { "description": "The label for category Getting started in sidebar docs", "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", "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", "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", "message": "Link label", }, - "version.label": Object { + "version.label": { "description": "The label for version 1.0.0", "message": "1.0.0 label", }, @@ -81,13 +81,13 @@ Array [ `; exports[`translateLoadedContent returns translated loaded content 1`] = ` -Object { - "loadedVersions": Array [ - Object { +{ + "loadedVersions": [ + { "contentPath": "any", "contentPathLocalized": "any", - "docs": Array [ - Object { + "docs": [ + { "description": "doc1 description", "editUrl": "any", "id": "doc1", @@ -103,7 +103,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc2 description", "editUrl": "any", "id": "doc2", @@ -119,7 +119,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc3 description", "editUrl": "any", "id": "doc3", @@ -135,7 +135,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc4 description", "editUrl": "any", "id": "doc4", @@ -151,7 +151,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc5 description", "editUrl": "any", "id": "doc5", @@ -172,31 +172,31 @@ Object { "mainDocId": "", "routePriority": undefined, "sidebarFilePath": "any", - "sidebars": Object { - "docs": Array [ - Object { + "sidebars": { + "docs": [ + { "collapsed": false, - "items": Array [ - Object { + "items": [ + { "id": "doc1", "type": "doc", }, - Object { + { "id": "doc2", "type": "doc", }, - Object { + { "href": "https://facebook.com", "label": "Link label (translated)", "type": "link", }, - Object { + { "id": "doc1", "type": "ref", }, ], "label": "Getting started (translated)", - "link": Object { + "link": { "description": "Getting started index description (translated)", "permalink": "/docs/category/getting-started-index-slug", "slug": "/category/getting-started-index-slug", @@ -205,17 +205,17 @@ Object { }, "type": "category", }, - Object { + { "id": "doc3", "type": "doc", }, ], - "otherSidebar": Array [ - Object { + "otherSidebar": [ + { "id": "doc4", "type": "doc", }, - Object { + { "id": "doc5", "type": "doc", }, @@ -225,11 +225,11 @@ Object { "versionName": "current", "versionPath": "/docs/", }, - Object { + { "contentPath": "any", "contentPathLocalized": "any", - "docs": Array [ - Object { + "docs": [ + { "description": "doc1 description", "editUrl": "any", "id": "doc1", @@ -245,7 +245,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc2 description", "editUrl": "any", "id": "doc2", @@ -261,7 +261,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc3 description", "editUrl": "any", "id": "doc3", @@ -277,7 +277,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc4 description", "editUrl": "any", "id": "doc4", @@ -293,7 +293,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc5 description", "editUrl": "any", "id": "doc5", @@ -314,31 +314,31 @@ Object { "mainDocId": "", "routePriority": undefined, "sidebarFilePath": "any", - "sidebars": Object { - "docs": Array [ - Object { + "sidebars": { + "docs": [ + { "collapsed": false, - "items": Array [ - Object { + "items": [ + { "id": "doc1", "type": "doc", }, - Object { + { "id": "doc2", "type": "doc", }, - Object { + { "href": "https://facebook.com", "label": "Link label (translated)", "type": "link", }, - Object { + { "id": "doc1", "type": "ref", }, ], "label": "Getting started (translated)", - "link": Object { + "link": { "description": "Getting started index description (translated)", "permalink": "/docs/category/getting-started-index-slug", "slug": "/category/getting-started-index-slug", @@ -347,17 +347,17 @@ Object { }, "type": "category", }, - Object { + { "id": "doc3", "type": "doc", }, ], - "otherSidebar": Array [ - Object { + "otherSidebar": [ + { "id": "doc4", "type": "doc", }, - Object { + { "id": "doc5", "type": "doc", }, @@ -367,11 +367,11 @@ Object { "versionName": "2.0.0", "versionPath": "/docs/", }, - Object { + { "contentPath": "any", "contentPathLocalized": "any", - "docs": Array [ - Object { + "docs": [ + { "description": "doc1 description", "editUrl": "any", "id": "doc1", @@ -387,7 +387,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc2 description", "editUrl": "any", "id": "doc2", @@ -403,7 +403,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc3 description", "editUrl": "any", "id": "doc3", @@ -419,7 +419,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc4 description", "editUrl": "any", "id": "doc4", @@ -435,7 +435,7 @@ Object { "unversionedId": "any", "version": "any", }, - Object { + { "description": "doc5 description", "editUrl": "any", "id": "doc5", @@ -456,31 +456,31 @@ Object { "mainDocId": "", "routePriority": undefined, "sidebarFilePath": "any", - "sidebars": Object { - "docs": Array [ - Object { + "sidebars": { + "docs": [ + { "collapsed": false, - "items": Array [ - Object { + "items": [ + { "id": "doc1", "type": "doc", }, - Object { + { "id": "doc2", "type": "doc", }, - Object { + { "href": "https://facebook.com", "label": "Link label (translated)", "type": "link", }, - Object { + { "id": "doc1", "type": "ref", }, ], "label": "Getting started (translated)", - "link": Object { + "link": { "description": "Getting started index description (translated)", "permalink": "/docs/category/getting-started-index-slug", "slug": "/category/getting-started-index-slug", @@ -489,17 +489,17 @@ Object { }, "type": "category", }, - Object { + { "id": "doc3", "type": "doc", }, ], - "otherSidebar": Array [ - Object { + "otherSidebar": [ + { "id": "doc4", "type": "doc", }, - Object { + { "id": "doc5", "type": "doc", }, diff --git a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/generator.test.ts.snap b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/generator.test.ts.snap index 91902a834a..3ab94d6010 100644 --- a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/generator.test.ts.snap +++ b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/generator.test.ts.snap @@ -1,54 +1,54 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`DefaultSidebarItemsGenerator generates complex nested sidebar 1`] = ` -Array [ - Object { +[ + { "id": "intro", "type": "doc", }, - Object { + { "collapsed": undefined, "collapsible": undefined, - "items": Array [ - Object { + "items": [ + { "id": "tutorial1", "type": "doc", }, - Object { + { "id": "tutorial2", "type": "doc", }, ], "label": "Tutorials", - "link": Object { + "link": { "id": "tutorials-index", "type": "doc", }, "type": "category", }, - Object { + { "collapsed": false, "collapsible": undefined, - "customProps": Object { + "customProps": { "description": "foo", }, - "items": Array [ - Object { + "items": [ + { "className": "foo", "id": "guide1", "type": "doc", }, - Object { + { "collapsed": undefined, "collapsible": undefined, - "items": Array [ - Object { + "items": [ + { "id": "nested-guide", "type": "doc", }, ], "label": "SubGuides (metadata file label)", - "link": Object { + "link": { "description": "subGuides-description", "slug": "subGuides-generated-index-slug", "title": "subGuides-title", @@ -56,19 +56,19 @@ Array [ }, "type": "category", }, - Object { + { "id": "guide2", "type": "doc", }, ], "label": "Guides", - "link": Object { + "link": { "id": "guides-index", "type": "doc", }, "type": "category", }, - Object { + { "id": "end", "type": "doc", }, @@ -76,25 +76,25 @@ Array [ `; exports[`DefaultSidebarItemsGenerator generates simple flat sidebar 1`] = ` -Array [ - Object { +[ + { "id": "doc3", "type": "doc", }, - Object { + { "id": "doc4", "type": "doc", }, - Object { + { "id": "doc1", "label": "doc1 sidebar label", "type": "doc", }, - Object { + { "id": "doc2", "type": "doc", }, - Object { + { "id": "doc5", "type": "doc", }, @@ -102,33 +102,33 @@ Array [ `; exports[`DefaultSidebarItemsGenerator generates subfolder sidebar 1`] = ` -Array [ - Object { +[ + { "collapsed": undefined, "collapsible": undefined, - "items": Array [ - Object { + "items": [ + { "id": "doc8", "type": "doc", }, - Object { + { "id": "doc7", "type": "doc", }, ], "label": "subsubsubfolder3 (_category_.json label)", - "link": Object { + "link": { "id": "doc1", "type": "doc", }, "type": "category", }, - Object { + { "className": "bar", "collapsed": undefined, "collapsible": undefined, - "items": Array [ - Object { + "items": [ + { "id": "doc6", "type": "doc", }, @@ -136,19 +136,19 @@ Array [ "label": "subsubsubfolder2 (_category_.yml label)", "type": "category", }, - Object { + { "id": "doc1", "type": "doc", }, - Object { + { "id": "doc4", "type": "doc", }, - Object { + { "collapsed": undefined, "collapsible": undefined, - "items": Array [ - Object { + "items": [ + { "id": "doc5", "type": "doc", }, @@ -160,45 +160,45 @@ Array [ `; exports[`DefaultSidebarItemsGenerator respects custom isCategoryIndex 1`] = ` -Array [ - Object { +[ + { "id": "intro", "type": "doc", }, - Object { + { "collapsed": undefined, "collapsible": undefined, - "items": Array [ - Object { + "items": [ + { "id": "tutorial1", "type": "doc", }, - Object { + { "id": "tutorial2", "type": "doc", }, ], "label": "Tutorials", - "link": Object { + "link": { "id": "tutorials-index", "type": "doc", }, "type": "category", }, - Object { + { "collapsed": undefined, "collapsible": undefined, - "items": Array [ - Object { + "items": [ + { "className": "foo", "id": "guide1", "type": "doc", }, - Object { + { "id": "guide2", "type": "doc", }, - Object { + { "id": "not-guides-index", "type": "doc", }, @@ -210,40 +210,40 @@ Array [ `; exports[`DefaultSidebarItemsGenerator uses explicit link over the index/readme.{md,mdx} naming convention 1`] = ` -Array [ - Object { +[ + { "collapsed": undefined, "collapsible": undefined, - "items": Array [ - Object { + "items": [ + { "id": "parent/doc2", "type": "doc", }, - Object { + { "id": "parent/doc1", "type": "doc", }, ], "label": "Category label", - "link": Object { + "link": { "id": "parent/doc3", "type": "doc", }, "type": "category", }, - Object { + { "collapsed": undefined, "collapsible": undefined, - "items": Array [ - Object { + "items": [ + { "id": "parent/doc4", "type": "doc", }, - Object { + { "id": "parent/doc6", "type": "doc", }, - Object { + { "id": "parent/doc5", "type": "doc", }, diff --git a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/index.test.ts.snap index ed1a6911de..42b1cd180d 100644 --- a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/index.test.ts.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`loadSidebars sidebars link 1`] = ` -Object { - "docs": Array [ - Object { +{ + "docs": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "href": "https://github.com", "label": "category", "type": "link", @@ -22,17 +22,17 @@ Object { `; exports[`loadSidebars sidebars with category.collapsed property 1`] = ` -Object { - "docs": Array [ - Object { +{ + "docs": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "collapsed": false, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "doc1", "type": "doc", }, @@ -46,15 +46,15 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "collapsed": false, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "doc2", "type": "doc", }, @@ -73,13 +73,13 @@ Object { `; exports[`loadSidebars sidebars with category.collapsed property at first level 1`] = ` -Object { - "docs": Array [ - Object { +{ + "docs": [ + { "collapsed": false, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "doc1", "type": "doc", }, @@ -88,11 +88,11 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": false, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "doc2", "type": "doc", }, @@ -106,41 +106,41 @@ Object { `; exports[`loadSidebars sidebars with deep level of category 1`] = ` -Object { - "docs": Array [ - Object { +{ + "docs": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "a", "type": "doc", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "c", "type": "doc", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "d", "type": "doc", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "e", "type": "doc", }, @@ -159,7 +159,7 @@ Object { "link": undefined, "type": "category", }, - Object { + { "id": "f", "type": "doc", }, @@ -178,13 +178,13 @@ Object { `; exports[`loadSidebars sidebars with first level not a category 1`] = ` -Object { - "docs": Array [ - Object { +{ + "docs": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "greeting", "type": "doc", }, @@ -193,7 +193,7 @@ Object { "link": undefined, "type": "category", }, - Object { + { "id": "api", "type": "doc", }, @@ -202,26 +202,26 @@ Object { `; exports[`loadSidebars sidebars with known sidebar item type 1`] = ` -Object { - "docs": Array [ - Object { +{ + "docs": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "foo/bar", "type": "doc", }, - Object { + { "id": "foo/baz", "type": "doc", }, - Object { + { "href": "https://github.com", "label": "Github", "type": "link", }, - Object { + { "id": "hello", "type": "ref", }, @@ -230,11 +230,11 @@ Object { "link": undefined, "type": "category", }, - Object { + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "hello", "type": "doc", }, @@ -248,13 +248,13 @@ Object { `; exports[`loadSidebars undefined path 1`] = ` -Object { - "defaultSidebar": Array [ - Object { +{ + "defaultSidebar": [ + { "collapsed": true, "collapsible": true, - "items": Array [ - Object { + "items": [ + { "id": "bar", "type": "doc", }, diff --git a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/normalization.test.ts.snap b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/normalization.test.ts.snap index 91efc153bb..f847163c30 100644 --- a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/normalization.test.ts.snap +++ b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/normalization.test.ts.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`normalization normalizes shorthands 1`] = ` -Object { - "sidebar": Array [ - Object { - "items": Array [ - Object { +{ + "sidebar": [ + { + "items": [ + { "id": "doc1", "type": "doc", }, - Object { + { "id": "doc2", "type": "doc", }, @@ -17,15 +17,15 @@ Object { "label": "Category", "type": "category", }, - Object { - "items": Array [ - Object { - "items": Array [ - Object { + { + "items": [ + { + "items": [ + { "id": "doc3", "type": "doc", }, - Object { + { "id": "doc4", "type": "doc", }, @@ -33,13 +33,13 @@ Object { "label": "Subcategory 1", "type": "category", }, - Object { - "items": Array [ - Object { + { + "items": [ + { "id": "doc5", "type": "doc", }, - Object { + { "id": "doc6", "type": "doc", }, @@ -56,20 +56,20 @@ Object { `; exports[`normalization normalizes shorthands 2`] = ` -Object { - "sidebar": Array [ - Object { +{ + "sidebar": [ + { "href": "https://google.com", "label": "Google", "type": "link", }, - Object { - "items": Array [ - Object { + { + "items": [ + { "id": "doc1", "type": "doc", }, - Object { + { "id": "doc2", "type": "doc", }, @@ -77,13 +77,13 @@ Object { "label": "Category 1", "type": "category", }, - Object { - "items": Array [ - Object { + { + "items": [ + { "id": "doc3", "type": "doc", }, - Object { + { "id": "doc4", "type": "doc", }, diff --git a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/postProcessor.test.ts.snap b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/postProcessor.test.ts.snap index 6e204eccd7..cb42628261 100644 --- a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/postProcessor.test.ts.snap +++ b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/__snapshots__/postProcessor.test.ts.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`postProcess corrects collapsed state inconsistencies 1`] = ` -Object { - "sidebar": Array [ - Object { +{ + "sidebar": [ + { "collapsed": false, "collapsible": false, - "items": Array [ - Object { + "items": [ + { "id": "foo", "type": "doc", }, @@ -21,13 +21,13 @@ Object { `; exports[`postProcess corrects collapsed state inconsistencies 2`] = ` -Object { - "sidebar": Array [ - Object { +{ + "sidebar": [ + { "collapsed": false, "collapsible": false, - "items": Array [ - Object { + "items": [ + { "id": "foo", "type": "doc", }, @@ -41,13 +41,13 @@ Object { `; exports[`postProcess corrects collapsed state inconsistencies 3`] = ` -Object { - "sidebar": Array [ - Object { +{ + "sidebar": [ + { "collapsed": false, "collapsible": false, - "items": Array [ - Object { + "items": [ + { "id": "foo", "type": "doc", }, @@ -61,14 +61,14 @@ Object { `; exports[`postProcess transforms category without subitems 1`] = ` -Object { - "sidebar": Array [ - Object { +{ + "sidebar": [ + { "href": "version/generated/permalink", "label": "Category", "type": "link", }, - Object { + { "id": "doc ID", "label": "Category 2", "type": "doc", diff --git a/packages/docusaurus-plugin-content-pages/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-plugin-content-pages/src/__tests__/__snapshots__/index.test.ts.snap index bc57b3355b..818f94da35 100644 --- a/packages/docusaurus-plugin-content-pages/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-plugin-content-pages/src/__tests__/__snapshots__/index.test.ts.snap @@ -1,28 +1,28 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`docusaurus-plugin-content-pages loads simple pages 1`] = ` -Array [ - Object { +[ + { "permalink": "/", "source": "@site/src/pages/index.js", "type": "jsx", }, - Object { + { "permalink": "/typescript", "source": "@site/src/pages/typescript.tsx", "type": "jsx", }, - Object { + { "description": "Markdown index page", - "frontMatter": Object {}, + "frontMatter": {}, "permalink": "/hello/", "source": "@site/src/pages/hello/index.md", "title": "Index", "type": "mdx", }, - Object { + { "description": "my mdx page", - "frontMatter": Object { + "frontMatter": { "description": "my mdx page", "title": "mdx page", }, @@ -31,20 +31,20 @@ Array [ "title": "mdx page", "type": "mdx", }, - Object { + { "permalink": "/hello/translatedJs", "source": "@site/src/pages/hello/translatedJs.js", "type": "jsx", }, - Object { + { "description": "translated markdown page", - "frontMatter": Object {}, + "frontMatter": {}, "permalink": "/hello/translatedMd", "source": "@site/src/pages/hello/translatedMd.md", "title": undefined, "type": "mdx", }, - Object { + { "permalink": "/hello/world", "source": "@site/src/pages/hello/world.js", "type": "jsx", @@ -53,28 +53,28 @@ Array [ `; exports[`docusaurus-plugin-content-pages loads simple pages with french translations 1`] = ` -Array [ - Object { +[ + { "permalink": "/", "source": "@site/src/pages/index.js", "type": "jsx", }, - Object { + { "permalink": "/typescript", "source": "@site/src/pages/typescript.tsx", "type": "jsx", }, - Object { + { "description": "Markdown index page", - "frontMatter": Object {}, + "frontMatter": {}, "permalink": "/hello/", "source": "@site/src/pages/hello/index.md", "title": "Index", "type": "mdx", }, - Object { + { "description": "my mdx page", - "frontMatter": Object { + "frontMatter": { "description": "my mdx page", "title": "mdx page", }, @@ -83,20 +83,20 @@ Array [ "title": "mdx page", "type": "mdx", }, - Object { + { "permalink": "/hello/translatedJs", "source": "@site/i18n/fr/docusaurus-plugin-content-pages/hello/translatedJs.js", "type": "jsx", }, - Object { + { "description": "translated markdown page (fr)", - "frontMatter": Object {}, + "frontMatter": {}, "permalink": "/hello/translatedMd", "source": "@site/i18n/fr/docusaurus-plugin-content-pages/hello/translatedMd.md", "title": undefined, "type": "mdx", }, - Object { + { "permalink": "/hello/world", "source": "@site/src/pages/hello/world.js", "type": "jsx", diff --git a/packages/docusaurus-theme-classic/src/__tests__/__snapshots__/translations.test.ts.snap b/packages/docusaurus-theme-classic/src/__tests__/__snapshots__/translations.test.ts.snap index 6d539a18cc..084840bf39 100644 --- a/packages/docusaurus-theme-classic/src/__tests__/__snapshots__/translations.test.ts.snap +++ b/packages/docusaurus-theme-classic/src/__tests__/__snapshots__/translations.test.ts.snap @@ -1,51 +1,51 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`getTranslationFiles returns translation files matching snapshot 1`] = ` -Array [ - Object { - "content": Object { - "item.label.Dropdown": Object { +[ + { + "content": { + "item.label.Dropdown": { "description": "Navbar item with label Dropdown", "message": "Dropdown", }, - "item.label.Dropdown item 1": Object { + "item.label.Dropdown item 1": { "description": "Navbar item with label 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", "message": "Dropdown item 2", }, - "title": Object { + "title": { "description": "The title in the navbar", "message": "navbar title", }, }, "path": "navbar", }, - Object { - "content": Object { - "copyright": Object { + { + "content": { + "copyright": { "description": "The footer copyright", "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", "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", "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", "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", "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", "message": "Footer link column 2", }, @@ -56,39 +56,39 @@ Array [ `; exports[`getTranslationFiles returns translation files matching snapshot 2`] = ` -Array [ - Object { - "content": Object { - "item.label.Dropdown": Object { +[ + { + "content": { + "item.label.Dropdown": { "description": "Navbar item with label Dropdown", "message": "Dropdown", }, - "item.label.Dropdown item 1": Object { + "item.label.Dropdown item 1": { "description": "Navbar item with label 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", "message": "Dropdown item 2", }, - "title": Object { + "title": { "description": "The title in the navbar", "message": "navbar title", }, }, "path": "navbar", }, - Object { - "content": Object { - "copyright": Object { + { + "content": { + "copyright": { "description": "The footer copyright", "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", "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", "message": "Link 2", }, @@ -99,31 +99,31 @@ Array [ `; exports[`translateThemeConfig returns translated themeConfig 1`] = ` -Object { - "announcementBar": Object {}, - "colorMode": Object {}, - "docs": Object { +{ + "announcementBar": {}, + "colorMode": {}, + "docs": { "versionPersistence": "none", }, - "footer": Object { + "footer": { "copyright": "Copyright FB (translated)", - "links": Array [ - Object { - "items": Array [ - Object { + "links": [ + { + "items": [ + { "label": "Link 1 (translated)", "to": "https://facebook.com", }, - Object { + { "label": "Link 2 (translated)", "to": "https://facebook.com", }, ], "title": "Footer link column 1 (translated)", }, - Object { - "items": Array [ - Object { + { + "items": [ + { "label": "Link 3 (translated)", "to": "https://facebook.com", }, @@ -134,17 +134,17 @@ Object { "style": "light", }, "hideableSidebar": true, - "navbar": Object { + "navbar": { "hideOnScroll": false, - "items": Array [ - Object { - "items": Array [ - Object { - "items": Array [], + "items": [ + { + "items": [ + { + "items": [], "label": "Dropdown item 1 (translated)", }, - Object { - "items": Array [], + { + "items": [], "label": "Dropdown item 2 (translated)", }, ], @@ -154,6 +154,6 @@ Object { "style": "dark", "title": "navbar title (translated)", }, - "prism": Object {}, + "prism": {}, } `; diff --git a/packages/docusaurus-theme-common/src/utils/__tests__/__snapshots__/codeBlockUtils.test.ts.snap b/packages/docusaurus-theme-common/src/utils/__tests__/__snapshots__/codeBlockUtils.test.ts.snap index 40f7d68143..97a8976893 100644 --- a/packages/docusaurus-theme-common/src/utils/__tests__/__snapshots__/codeBlockUtils.test.ts.snap +++ b/packages/docusaurus-theme-common/src/utils/__tests__/__snapshots__/codeBlockUtils.test.ts.snap @@ -1,71 +1,71 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`parseLines does not parse content with metastring 1`] = ` -Object { +{ "code": "aaaaa nnnnn", - "highlightLines": Array [ + "highlightLines": [ 0, ], } `; exports[`parseLines does not parse content with metastring 2`] = ` -Object { +{ "code": "// highlight-next-line aaaaa bbbbb", - "highlightLines": Array [ + "highlightLines": [ 0, ], } `; exports[`parseLines does not parse content with metastring 3`] = ` -Object { +{ "code": "aaaaa bbbbb", - "highlightLines": Array [ + "highlightLines": [ 0, ], } `; exports[`parseLines does not parse content with no language 1`] = ` -Object { +{ "code": "// highlight-next-line aaaaa bbbbb", - "highlightLines": Array [], + "highlightLines": [], } `; exports[`parseLines removes lines correctly 1`] = ` -Object { +{ "code": "aaaaa bbbbb", - "highlightLines": Array [ + "highlightLines": [ 0, ], } `; exports[`parseLines removes lines correctly 2`] = ` -Object { +{ "code": "aaaaa bbbbb", - "highlightLines": Array [ + "highlightLines": [ 0, ], } `; exports[`parseLines removes lines correctly 3`] = ` -Object { +{ "code": "aaaaa bbbbbbb bbbbb", - "highlightLines": Array [ + "highlightLines": [ 0, 2, 0, @@ -75,25 +75,25 @@ bbbbb", `; exports[`parseLines respects language 1`] = ` -Object { +{ "code": "# highlight-next-line aaaaa bbbbb", - "highlightLines": Array [], + "highlightLines": [], } `; exports[`parseLines respects language 2`] = ` -Object { +{ "code": "/* highlight-next-line */ aaaaa bbbbb", - "highlightLines": Array [], + "highlightLines": [], } `; exports[`parseLines respects language 3`] = ` -Object { +{ "code": "// highlight-next-line aaaa /* highlight-next-line */ @@ -101,19 +101,19 @@ bbbbb ccccc dddd", - "highlightLines": Array [ + "highlightLines": [ 4, ], } `; exports[`parseLines respects language 4`] = ` -Object { +{ "code": "aaaa bbbbb ccccc dddd", - "highlightLines": Array [ + "highlightLines": [ 0, 1, 2, diff --git a/packages/docusaurus-theme-common/src/utils/__tests__/__snapshots__/tocUtils.test.ts.snap b/packages/docusaurus-theme-common/src/utils/__tests__/__snapshots__/tocUtils.test.ts.snap index 45df110aa8..2ed8b17ac0 100644 --- a/packages/docusaurus-theme-common/src/utils/__tests__/__snapshots__/tocUtils.test.ts.snap +++ b/packages/docusaurus-theme-common/src/utils/__tests__/__snapshots__/tocUtils.test.ts.snap @@ -1,17 +1,17 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`useTreeifiedTOC treeifies TOC without filtering 1`] = ` -Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], +[ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], "id": "foxtrot", "level": 6, "value": "Foxtrot", diff --git a/packages/docusaurus-utils/src/__tests__/__snapshots__/markdownLinks.test.ts.snap b/packages/docusaurus-utils/src/__tests__/__snapshots__/markdownLinks.test.ts.snap index 1d0e85e558..f8d2b1f787 100644 --- a/packages/docusaurus-utils/src/__tests__/__snapshots__/markdownLinks.test.ts.snap +++ b/packages/docusaurus-utils/src/__tests__/__snapshots__/markdownLinks.test.ts.snap @@ -1,10 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`replaceMarkdownLinks does basic replace 1`] = ` -Object { - "brokenMarkdownLinks": Array [ - Object { - "contentPaths": Object { +{ + "brokenMarkdownLinks": [ + { + "contentPaths": { "contentPath": "docs", "contentPathLocalized": "i18n/docs-localized", }, @@ -27,18 +27,18 @@ Object { `; exports[`replaceMarkdownLinks ignores links in HTML comments 1`] = ` -Object { - "brokenMarkdownLinks": Array [ - Object { - "contentPaths": Object { +{ + "brokenMarkdownLinks": [ + { + "contentPaths": { "contentPath": "docs", "contentPathLocalized": "i18n/docs-localized", }, "filePath": "docs/intro.md", "link": "./foo.md", }, - Object { - "contentPaths": Object { + { + "contentPaths": { "contentPath": "docs", "contentPathLocalized": "i18n/docs-localized", }, @@ -56,8 +56,8 @@ Object { `; exports[`replaceMarkdownLinks ignores links in fenced blocks 1`] = ` -Object { - "brokenMarkdownLinks": Array [], +{ + "brokenMarkdownLinks": [], "newContent": " \`\`\` [foo](foo.md) @@ -81,10 +81,10 @@ Object { `; exports[`replaceMarkdownLinks ignores links in inline code 1`] = ` -Object { - "brokenMarkdownLinks": Array [ - Object { - "contentPaths": Object { +{ + "brokenMarkdownLinks": [ + { + "contentPaths": { "contentPath": "docs", "contentPathLocalized": "i18n/docs-localized", }, @@ -99,8 +99,8 @@ Object { `; exports[`replaceMarkdownLinks replaces links with same title as URL 1`] = ` -Object { - "brokenMarkdownLinks": Array [], +{ + "brokenMarkdownLinks": [], "newContent": " [/docs/foo](foo.md) [/docs/foo](./foo.md) @@ -111,8 +111,8 @@ Object { `; exports[`replaceMarkdownLinks replaces multiple links on same line 1`] = ` -Object { - "brokenMarkdownLinks": Array [], +{ + "brokenMarkdownLinks": [], "newContent": " [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`] = ` -Object { - "brokenMarkdownLinks": Array [], +{ + "brokenMarkdownLinks": [], "newContent": " The following operations are defined for [URI]s: diff --git a/packages/docusaurus-utils/src/__tests__/__snapshots__/markdownParser.test.ts.snap b/packages/docusaurus-utils/src/__tests__/__snapshots__/markdownParser.test.ts.snap index 50b866f0b5..5a65f0bb82 100644 --- a/packages/docusaurus-utils/src/__tests__/__snapshots__/markdownParser.test.ts.snap +++ b/packages/docusaurus-utils/src/__tests__/__snapshots__/markdownParser.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`parseMarkdownString deletes only first heading 1`] = ` -Object { +{ "content": "# Markdown Title test test test # test bar @@ -11,12 +11,12 @@ test test test # test bar ### Markdown Title h3", "contentTitle": "Markdown Title", "excerpt": "test test test # test bar", - "frontMatter": Object {}, + "frontMatter": {}, } `; exports[`parseMarkdownString deletes only first heading 2 1`] = ` -Object { +{ "content": "# test test test test test test test @@ -26,25 +26,25 @@ test test test # test bar test3", "contentTitle": "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`] = ` -Object { +{ "content": "foo # Markdown Title", "contentTitle": undefined, "excerpt": "foo", - "frontMatter": Object { + "frontMatter": { "title": "Frontmatter title", }, } `; exports[`parseMarkdownString handles code blocks 1`] = ` -Object { +{ "content": "\`\`\`js code \`\`\` @@ -52,12 +52,12 @@ code Content", "contentTitle": undefined, "excerpt": "Content", - "frontMatter": Object {}, + "frontMatter": {}, } `; exports[`parseMarkdownString handles code blocks 2`] = ` -Object { +{ "content": "\`\`\`\`js Foo \`\`\`diff @@ -69,12 +69,12 @@ Bar Content", "contentTitle": undefined, "excerpt": "Content", - "frontMatter": Object {}, + "frontMatter": {}, } `; exports[`parseMarkdownString handles code blocks 3`] = ` -Object { +{ "content": "\`\`\`\`js Foo \`\`\`diff @@ -84,116 +84,116 @@ code Content", "contentTitle": undefined, "excerpt": "Content", - "frontMatter": Object {}, + "frontMatter": {}, } `; exports[`parseMarkdownString ignores markdown title if its not a first text 1`] = ` -Object { +{ "content": "foo # test", "contentTitle": undefined, "excerpt": "foo", - "frontMatter": Object {}, + "frontMatter": {}, } `; exports[`parseMarkdownString parse markdown with front matter 1`] = ` -Object { +{ "content": "Some text", "contentTitle": undefined, "excerpt": "Some text", - "frontMatter": Object { + "frontMatter": { "title": "Frontmatter title", }, } `; exports[`parseMarkdownString parses first heading as contentTitle 1`] = ` -Object { +{ "content": "# Markdown Title Some text", "contentTitle": "Markdown Title", "excerpt": "Some text", - "frontMatter": Object {}, + "frontMatter": {}, } `; exports[`parseMarkdownString parses front-matter and ignore h2 1`] = ` -Object { +{ "content": "## test", "contentTitle": undefined, "excerpt": "test", - "frontMatter": Object { + "frontMatter": { "title": "Frontmatter title", }, } `; exports[`parseMarkdownString parses title only 1`] = ` -Object { +{ "content": "# test", "contentTitle": "test", "excerpt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, } `; exports[`parseMarkdownString parses title only alternate 1`] = ` -Object { +{ "content": "test ===", "contentTitle": "test", "excerpt": undefined, - "frontMatter": Object {}, + "frontMatter": {}, } `; exports[`parseMarkdownString reads front matter only 1`] = ` -Object { +{ "content": "", "contentTitle": undefined, "excerpt": undefined, - "frontMatter": Object { + "frontMatter": { "title": "test", }, } `; exports[`parseMarkdownString warns about duplicate titles (front matter + markdown alternate) 1`] = ` -Object { +{ "content": "Markdown Title alternate ================ Some text", "contentTitle": "Markdown Title alternate", "excerpt": "Some text", - "frontMatter": Object { + "frontMatter": { "title": "Frontmatter title", }, } `; exports[`parseMarkdownString warns about duplicate titles (front matter + markdown) 1`] = ` -Object { +{ "content": "# Markdown Title Some text", "contentTitle": "Markdown Title", "excerpt": "Some text", - "frontMatter": Object { + "frontMatter": { "title": "Frontmatter title", }, } `; exports[`parseMarkdownString warns about duplicate titles 1`] = ` -Object { +{ "content": "# test", "contentTitle": "test", "excerpt": undefined, - "frontMatter": Object { + "frontMatter": { "title": "Frontmatter title", }, } diff --git a/packages/docusaurus/src/client/exports/__tests__/BrowserOnly.test.tsx b/packages/docusaurus/src/client/exports/__tests__/BrowserOnly.test.tsx index 7ab1c09720..14a12b8d06 100644 --- a/packages/docusaurus/src/client/exports/__tests__/BrowserOnly.test.tsx +++ b/packages/docusaurus/src/client/exports/__tests__/BrowserOnly.test.tsx @@ -3,14 +3,29 @@ * * This source code is licensed under the MIT license found in the * 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 renderer from 'react-test-renderer'; import BrowserOnly from '../BrowserOnly'; import {Context} from '../browserContext'; describe('', () => { + const originalEnv = process.env; + + beforeEach(() => { + jest.resetModules(); + process.env = {...originalEnv}; + }); + + afterAll(() => { + process.env = originalEnv; + }); + it('rejects react element children', () => { process.env.NODE_ENV = 'development'; expect(() => @@ -58,7 +73,7 @@ describe('', () => { .toJSON(), ).toMatchInlineSnapshot(` - https://docusaurus.io + https://docusaurus.io/ `); }); diff --git a/packages/docusaurus/src/client/exports/__tests__/__snapshots__/Interpolate.test.tsx.snap b/packages/docusaurus/src/client/exports/__tests__/__snapshots__/Interpolate.test.tsx.snap index 09d0dcadd9..9136a8e12d 100644 --- a/packages/docusaurus/src/client/exports/__tests__/__snapshots__/Interpolate.test.tsx.snap +++ b/packages/docusaurus/src/client/exports/__tests__/__snapshots__/Interpolate.test.tsx.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[` acceptance test 1`] = ` -Array [ +[ "Hello ", "Sébastien", " how are you ", @@ -13,7 +13,7 @@ Array [ `; exports[`interpolate acceptance test 1`] = ` -Array [ +[ Hello Sébastien @@ -31,7 +31,7 @@ Array [ `; exports[`interpolate placeholders with JSX values 1`] = ` -Array [ +[ Hello @@ -51,7 +51,7 @@ Array [ `; exports[`interpolate placeholders with mixed vales 1`] = ` -Array [ +[ Hello Sébastien diff --git a/packages/docusaurus/src/client/exports/__tests__/docusaurusContext.test.tsx b/packages/docusaurus/src/client/exports/__tests__/docusaurusContext.test.tsx index 062591f3b4..1fa41bed04 100644 --- a/packages/docusaurus/src/client/exports/__tests__/docusaurusContext.test.tsx +++ b/packages/docusaurus/src/client/exports/__tests__/docusaurusContext.test.tsx @@ -25,12 +25,12 @@ describe('DocusaurusContextProvider', () => { const value = result.current; it('returns right value', () => { expect(value).toMatchInlineSnapshot(` - Object { - "codeTranslations": Object {}, - "globalData": Object {}, - "i18n": Object {}, - "siteConfig": Object {}, - "siteMetadata": Object {}, + { + "codeTranslations": {}, + "globalData": {}, + "i18n": {}, + "siteConfig": {}, + "siteMetadata": {}, } `); }); diff --git a/packages/docusaurus/src/commands/swizzle/__tests__/__snapshots__/config.test.ts.snap b/packages/docusaurus/src/commands/swizzle/__tests__/__snapshots__/config.test.ts.snap index eeba7c337e..333429f83a 100644 --- a/packages/docusaurus/src/commands/swizzle/__tests__/__snapshots__/config.test.ts.snap +++ b/packages/docusaurus/src/commands/swizzle/__tests__/__snapshots__/config.test.ts.snap @@ -1,16 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`normalizeSwizzleConfig normalize partial config 1`] = ` -Object { - "components": Object { - "Other/Component": Object { - "actions": Object { +{ + "components": { + "Other/Component": { + "actions": { "eject": "unsafe", "wrap": "forbidden", }, }, - "SomeComponent": Object { - "actions": Object { + "SomeComponent": { + "actions": { "eject": "safe", "wrap": "unsafe", }, diff --git a/packages/docusaurus/src/commands/swizzle/__tests__/components.test.ts b/packages/docusaurus/src/commands/swizzle/__tests__/components.test.ts index 7a5b3db9b6..d278e727aa 100644 --- a/packages/docusaurus/src/commands/swizzle/__tests__/components.test.ts +++ b/packages/docusaurus/src/commands/swizzle/__tests__/components.test.ts @@ -77,8 +77,8 @@ describe('getThemeComponents', () => { }); expect(themeComponents.getConfig(Components.ComponentInFolder)) .toMatchInlineSnapshot(` - Object { - "actions": Object { + { + "actions": { "eject": "unsafe", "wrap": "safe", }, @@ -87,8 +87,8 @@ describe('getThemeComponents', () => { `); expect(themeComponents.getConfig(Components.ComponentInSubFolder)) .toMatchInlineSnapshot(` - Object { - "actions": Object { + { + "actions": { "eject": "safe", "wrap": "unsafe", }, @@ -96,8 +96,8 @@ describe('getThemeComponents', () => { `); expect(themeComponents.getConfig(Components.FirstLevelComponent)) .toMatchInlineSnapshot(` - Object { - "actions": Object { + { + "actions": { "eject": "unsafe", "wrap": "unsafe", }, diff --git a/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap b/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap index ac70cb4e3f..05963da88a 100644 --- a/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap +++ b/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap @@ -12,15 +12,15 @@ See https://docusaurus.io/docs/docusaurus.config.js/#customfields" `; exports[`loadConfig website with valid async config 1`] = ` -Object { +{ "baseUrl": "/", "baseUrlIssueBanner": true, - "clientModules": Array [], - "customFields": Object {}, - "i18n": Object { + "clientModules": [], + "customFields": {}, + "i18n": { "defaultLocale": "en", - "localeConfigs": Object {}, - "locales": Array [ + "localeConfigs": {}, + "locales": [ "en", ], }, @@ -29,17 +29,17 @@ Object { "onBrokenMarkdownLinks": "warn", "onDuplicateRoutes": "warn", "organizationName": "endiliey", - "plugins": Array [], - "presets": Array [], + "plugins": [], + "presets": [], "projectName": "hello", - "scripts": Array [], - "staticDirectories": Array [ + "scripts": [], + "staticDirectories": [ "static", ], - "stylesheets": Array [], + "stylesheets": [], "tagline": "Hello World", - "themeConfig": Object {}, - "themes": Array [], + "themeConfig": {}, + "themes": [], "title": "Hello", "titleDelimiter": "|", "url": "https://docusaurus.io", @@ -47,15 +47,15 @@ Object { `; exports[`loadConfig website with valid async config creator function 1`] = ` -Object { +{ "baseUrl": "/", "baseUrlIssueBanner": true, - "clientModules": Array [], - "customFields": Object {}, - "i18n": Object { + "clientModules": [], + "customFields": {}, + "i18n": { "defaultLocale": "en", - "localeConfigs": Object {}, - "locales": Array [ + "localeConfigs": {}, + "locales": [ "en", ], }, @@ -64,17 +64,17 @@ Object { "onBrokenMarkdownLinks": "warn", "onDuplicateRoutes": "warn", "organizationName": "endiliey", - "plugins": Array [], - "presets": Array [], + "plugins": [], + "presets": [], "projectName": "hello", - "scripts": Array [], - "staticDirectories": Array [ + "scripts": [], + "staticDirectories": [ "static", ], - "stylesheets": Array [], + "stylesheets": [], "tagline": "Hello World", - "themeConfig": Object {}, - "themes": Array [], + "themeConfig": {}, + "themes": [], "title": "Hello", "titleDelimiter": "|", "url": "https://docusaurus.io", @@ -82,15 +82,15 @@ Object { `; exports[`loadConfig website with valid config creator function 1`] = ` -Object { +{ "baseUrl": "/", "baseUrlIssueBanner": true, - "clientModules": Array [], - "customFields": Object {}, - "i18n": Object { + "clientModules": [], + "customFields": {}, + "i18n": { "defaultLocale": "en", - "localeConfigs": Object {}, - "locales": Array [ + "localeConfigs": {}, + "locales": [ "en", ], }, @@ -99,17 +99,17 @@ Object { "onBrokenMarkdownLinks": "warn", "onDuplicateRoutes": "warn", "organizationName": "endiliey", - "plugins": Array [], - "presets": Array [], + "plugins": [], + "presets": [], "projectName": "hello", - "scripts": Array [], - "staticDirectories": Array [ + "scripts": [], + "staticDirectories": [ "static", ], - "stylesheets": Array [], + "stylesheets": [], "tagline": "Hello World", - "themeConfig": Object {}, - "themes": Array [], + "themeConfig": {}, + "themes": [], "title": "Hello", "titleDelimiter": "|", "url": "https://docusaurus.io", @@ -117,16 +117,16 @@ Object { `; exports[`loadConfig website with valid siteConfig 1`] = ` -Object { +{ "baseUrl": "/", "baseUrlIssueBanner": true, - "clientModules": Array [], - "customFields": Object {}, + "clientModules": [], + "customFields": {}, "favicon": "img/docusaurus.ico", - "i18n": Object { + "i18n": { "defaultLocale": "en", - "localeConfigs": Object {}, - "locales": Array [ + "localeConfigs": {}, + "locales": [ "en", ], }, @@ -135,25 +135,25 @@ Object { "onBrokenMarkdownLinks": "warn", "onDuplicateRoutes": "warn", "organizationName": "endiliey", - "plugins": Array [ - Array [ + "plugins": [ + [ "@docusaurus/plugin-content-docs", - Object { + { "path": "../docs", }, ], "@docusaurus/plugin-content-pages", ], - "presets": Array [], + "presets": [], "projectName": "hello", - "scripts": Array [], - "staticDirectories": Array [ + "scripts": [], + "staticDirectories": [ "static", ], - "stylesheets": Array [], + "stylesheets": [], "tagline": "Hello World", - "themeConfig": Object {}, - "themes": Array [], + "themeConfig": {}, + "themes": [], "title": "Hello", "titleDelimiter": "|", "url": "https://docusaurus.io", diff --git a/packages/docusaurus/src/server/__tests__/__snapshots__/routes.test.ts.snap b/packages/docusaurus/src/server/__tests__/__snapshots__/routes.test.ts.snap index ef427a200f..e575e8024f 100644 --- a/packages/docusaurus/src/server/__tests__/__snapshots__/routes.test.ts.snap +++ b/packages/docusaurus/src/server/__tests__/__snapshots__/routes.test.ts.snap @@ -1,34 +1,34 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`loadRoutes loads flat route config 1`] = ` -Object { - "registry": Object { - "component---theme-blog-list-pagea-6-a-7ba": Object { +{ + "registry": { + "component---theme-blog-list-pagea-6-a-7ba": { "loader": "() => import(/* webpackChunkName: 'component---theme-blog-list-pagea-6-a-7ba' */ '@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')", "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')", "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')", "modulePath": "blog-2018-12-14-happy-first-birthday-slash-d2c.json", }, }, - "routesChunkNames": Object { - "/blog-94e": Object { + "routesChunkNames": { + "/blog-94e": { "component": "component---theme-blog-list-pagea-6-a-7ba", - "items": Array [ - Object { + "items": [ + { "content": "content---blog-0-b-4-09e", "metadata": "metadata---blog-0-b-6-74c", }, - Object { + { "content": "content---blog-7-b-8-fd9", "metadata": null, }, @@ -51,7 +51,7 @@ export default [ } ]; ", - "routesPaths": Array [ + "routesPaths": [ "/404.html", "/blog", ], @@ -59,48 +59,48 @@ export default [ `; exports[`loadRoutes loads nested route config 1`] = ` -Object { - "registry": Object { - "component---theme-doc-item-178-a40": Object { +{ + "registry": { + "component---theme-doc-item-178-a40": { "loader": "() => import(/* webpackChunkName: 'component---theme-doc-item-178-a40' */ '@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')", "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')", "modulePath": "docs/foo/baz.md", }, - "content---docs-helloaff-811": Object { + "content---docs-helloaff-811": { "loader": "() => import(/* webpackChunkName: 'content---docs-helloaff-811' */ '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')", "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')", "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')", "modulePath": "docs-hello-da2.json", }, }, - "routesChunkNames": Object { - "/docs/hello-44b": Object { + "routesChunkNames": { + "/docs/hello-44b": { "component": "component---theme-doc-item-178-a40", "content": "content---docs-helloaff-811", "metadata": "metadata---docs-hello-956-741", }, - "/docs:route-63b": Object { + "/docs:route-63b": { "component": "component---theme-doc-page-1-be-9be", "docsMetadata": "docsMetadata---docs-routef-34-881", }, - "docs/foo/baz-ac2": Object { + "docs/foo/baz-ac2": { "component": "component---theme-doc-item-178-a40", "content": "content---docs-foo-baz-8-ce-61e", "metadata": "metadata---docs-foo-baz-2-cf-fa7", @@ -134,7 +134,7 @@ export default [ } ]; ", - "routesPaths": Array [ + "routesPaths": [ "/404.html", "/docs/hello", "docs/foo/baz", @@ -143,15 +143,15 @@ export default [ `; exports[`loadRoutes loads route config with empty (but valid) path string 1`] = ` -Object { - "registry": Object { - "component---hello-world-jse-0-f-b6c": Object { +{ + "registry": { + "component---hello-world-jse-0-f-b6c": { "loader": "() => import(/* webpackChunkName: 'component---hello-world-jse-0-f-b6c' */ 'hello/world.js')", "modulePath": "hello/world.js", }, }, - "routesChunkNames": Object { - "-b2a": Object { + "routesChunkNames": { + "-b2a": { "component": "component---hello-world-jse-0-f-b6c", }, }, @@ -170,7 +170,7 @@ export default [ } ]; ", - "routesPaths": Array [ + "routesPaths": [ "/404.html", "", ], diff --git a/packages/docusaurus/src/server/client-modules/__tests__/index.test.ts b/packages/docusaurus/src/server/client-modules/__tests__/index.test.ts index de01447dc0..46744e2d3a 100644 --- a/packages/docusaurus/src/server/client-modules/__tests__/index.test.ts +++ b/packages/docusaurus/src/server/client-modules/__tests__/index.test.ts @@ -14,13 +14,13 @@ import pluginHelloWorld from './__fixtures__/plugin-hello-world'; describe('loadClientModules', () => { it('empty', () => { const clientModules = loadClientModules([pluginEmpty()]); - expect(clientModules).toMatchInlineSnapshot(`Array []`); + expect(clientModules).toMatchInlineSnapshot(`[]`); }); it('non-empty', () => { const clientModules = loadClientModules([pluginFooBar()]); expect(clientModules).toMatchInlineSnapshot(` - Array [ + [ "foo", "bar", ] @@ -33,7 +33,7 @@ describe('loadClientModules', () => { pluginHelloWorld(), ]); expect(clientModules).toMatchInlineSnapshot(` - Array [ + [ "foo", "bar", "hello", @@ -48,7 +48,7 @@ describe('loadClientModules', () => { pluginFooBar(), ]); expect(clientModules).toMatchInlineSnapshot(` - Array [ + [ "hello", "world", "foo", @@ -64,7 +64,7 @@ describe('loadClientModules', () => { pluginFooBar(), ]); expect(clientModules).toMatchInlineSnapshot(` - Array [ + [ "hello", "world", "foo", @@ -80,7 +80,7 @@ describe('loadClientModules', () => { pluginEmpty(), ]); expect(clientModules).toMatchInlineSnapshot(` - Array [ + [ "hello", "world", "foo", diff --git a/packages/docusaurus/src/server/html-tags/__tests__/index.test.ts b/packages/docusaurus/src/server/html-tags/__tests__/index.test.ts index 7b204ab38a..19786fbea4 100644 --- a/packages/docusaurus/src/server/html-tags/__tests__/index.test.ts +++ b/packages/docusaurus/src/server/html-tags/__tests__/index.test.ts @@ -16,7 +16,7 @@ describe('loadHtmlTags', () => { it('empty plugin', () => { const htmlTags = loadHtmlTags([pluginEmpty()]); expect(htmlTags).toMatchInlineSnapshot(` - Object { + { "headTags": "", "postBodyTags": "", "preBodyTags": "", @@ -27,7 +27,7 @@ describe('loadHtmlTags', () => { it('only inject headTags', () => { const htmlTags = loadHtmlTags([pluginHeadTags()]); expect(htmlTags).toMatchInlineSnapshot(` - Object { + { "headTags": " ", "postBodyTags": "", @@ -39,7 +39,7 @@ describe('loadHtmlTags', () => { it('only inject preBodyTags', () => { const htmlTags = loadHtmlTags([pluginPreBodyTags()]); expect(htmlTags).toMatchInlineSnapshot(` - Object { + { "headTags": "", "postBodyTags": "", "preBodyTags": "", @@ -50,7 +50,7 @@ describe('loadHtmlTags', () => { it('only inject postBodyTags', () => { const htmlTags = loadHtmlTags([pluginPostBodyTags()]); expect(htmlTags).toMatchInlineSnapshot(` - Object { + { "headTags": "", "postBodyTags": "
Test content
", "preBodyTags": "", @@ -65,7 +65,7 @@ describe('loadHtmlTags', () => { pluginPreBodyTags(), ]); expect(htmlTags).toMatchInlineSnapshot(` - Object { + { "headTags": " ", "postBodyTags": "
Test content
", @@ -81,7 +81,7 @@ describe('loadHtmlTags', () => { pluginPostBodyTags(), ]); expect(htmlTags).toMatchInlineSnapshot(` - Object { + { "headTags": " ", "postBodyTags": "
Test content
", diff --git a/packages/docusaurus/src/server/plugins/__tests__/__snapshots__/init.test.ts.snap b/packages/docusaurus/src/server/plugins/__tests__/__snapshots__/init.test.ts.snap index 178307afa6..2d8f4c1cad 100644 --- a/packages/docusaurus/src/server/plugins/__tests__/__snapshots__/init.test.ts.snap +++ b/packages/docusaurus/src/server/plugins/__tests__/__snapshots__/init.test.ts.snap @@ -29,52 +29,52 @@ Example valid plugin config: `; exports[`sortConfig sorts route config correctly 1`] = ` -Array [ - Object { +[ + { "component": "", "path": "/community", }, - Object { + { "component": "", "path": "/some-page", }, - Object { + { "component": "", "path": "/docs", - "routes": Array [ - Object { + "routes": [ + { "component": "", "path": "/docs/someDoc", }, - Object { + { "component": "", "path": "/docs/someOtherDoc", }, ], }, - Object { + { "component": "", "path": "/", }, - Object { + { "component": "", "path": "/", - "routes": Array [ - Object { + "routes": [ + { "component": "", "path": "/someDoc", }, - Object { + { "component": "", "path": "/someOtherDoc", }, ], }, - Object { + { "component": "", "path": "/", - "routes": Array [ - Object { + "routes": [ + { "component": "", "path": "/subroute", }, @@ -84,42 +84,42 @@ Array [ `; exports[`sortConfig sorts route config given a baseURL 1`] = ` -Array [ - Object { +[ + { "component": "", "path": "/latest/community", }, - Object { + { "component": "", "path": "/latest/example", }, - Object { + { "component": "", "path": "/latest/some-page", }, - Object { + { "component": "", "path": "/latest/docs", - "routes": Array [ - Object { + "routes": [ + { "component": "", "path": "/latest/docs/someDoc", }, - Object { + { "component": "", "path": "/latest/docs/someOtherDoc", }, ], }, - Object { + { "component": "", "path": "/latest", - "routes": Array [ - Object { + "routes": [ + { "component": "", "path": "/latest/someDoc", }, - Object { + { "component": "", "path": "/latest/someOtherDoc", }, diff --git a/packages/docusaurus/src/server/presets/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus/src/server/presets/__tests__/__snapshots__/index.test.ts.snap index 34a36d41fc..160beefa43 100644 --- a/packages/docusaurus/src/server/presets/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus/src/server/presets/__tests__/__snapshots__/index.test.ts.snap @@ -1,121 +1,121 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`loadPresets array form 1`] = ` -Object { - "plugins": Array [ - Array [ +{ + "plugins": [ + [ "@docusaurus/plugin-content-docs", undefined, ], - Array [ + [ "@docusaurus/plugin-content-blog", undefined, ], ], - "themes": Array [], + "themes": [], } `; exports[`loadPresets array form composite 1`] = ` -Object { - "plugins": Array [ - Array [ +{ + "plugins": [ + [ "@docusaurus/plugin-content-docs", - Object { + { "path": "../", }, ], - Array [ + [ "@docusaurus/plugin-content-blog", undefined, ], - Array [ + [ "@docusaurus/plugin-content-pages", - Object { + { "path": "../", }, ], - Array [ + [ "@docusaurus/plugin-sitemap", undefined, ], ], - "themes": Array [], + "themes": [], } `; exports[`loadPresets array form with options 1`] = ` -Object { - "plugins": Array [ - Array [ +{ + "plugins": [ + [ "@docusaurus/plugin-content-docs", - Object { + { "path": "../", }, ], - Array [ + [ "@docusaurus/plugin-content-blog", undefined, ], ], - "themes": Array [], + "themes": [], } `; exports[`loadPresets mixed form 1`] = ` -Object { - "plugins": Array [ - Array [ +{ + "plugins": [ + [ "@docusaurus/plugin-content-docs", - Object { + { "path": "../", }, ], - Array [ + [ "@docusaurus/plugin-content-blog", undefined, ], - Array [ + [ "@docusaurus/plugin-content-pages", undefined, ], - Array [ + [ "@docusaurus/plugin-sitemap", undefined, ], ], - "themes": Array [], + "themes": [], } `; exports[`loadPresets mixed form with themes 1`] = ` -Object { - "plugins": Array [ - Array [ +{ + "plugins": [ + [ "@docusaurus/plugin-content-docs", - Object { + { "path": "../", }, ], - Array [ + [ "@docusaurus/plugin-content-blog", undefined, ], - Array [ + [ "@docusaurus/plugin-content-pages", undefined, ], - Array [ + [ "@docusaurus/plugin-sitemap", undefined, ], - Array [ + [ "@docusaurus/plugin-test", undefined, ], ], - "themes": Array [ - Array [ + "themes": [ + [ "@docusaurus/theme-classic", undefined, ], @@ -124,41 +124,41 @@ Object { `; exports[`loadPresets string form 1`] = ` -Object { - "plugins": Array [ - Array [ +{ + "plugins": [ + [ "@docusaurus/plugin-content-docs", undefined, ], - Array [ + [ "@docusaurus/plugin-content-blog", undefined, ], ], - "themes": Array [], + "themes": [], } `; exports[`loadPresets string form composite 1`] = ` -Object { - "plugins": Array [ - Array [ +{ + "plugins": [ + [ "@docusaurus/plugin-content-docs", undefined, ], - Array [ + [ "@docusaurus/plugin-content-blog", undefined, ], - Array [ + [ "@docusaurus/plugin-content-pages", undefined, ], - Array [ + [ "@docusaurus/plugin-sitemap", undefined, ], ], - "themes": Array [], + "themes": [], } `; diff --git a/packages/docusaurus/src/server/presets/__tests__/index.test.ts b/packages/docusaurus/src/server/presets/__tests__/index.test.ts index 6826159753..444c597238 100644 --- a/packages/docusaurus/src/server/presets/__tests__/index.test.ts +++ b/packages/docusaurus/src/server/presets/__tests__/index.test.ts @@ -20,9 +20,9 @@ describe('loadPresets', () => { } as LoadContext; const presets = await loadPresets(context); expect(presets).toMatchInlineSnapshot(` - Object { - "plugins": Array [], - "themes": Array [], + { + "plugins": [], + "themes": [], } `); }); diff --git a/packages/docusaurus/src/webpack/__tests__/__snapshots__/base.test.ts.snap b/packages/docusaurus/src/webpack/__tests__/__snapshots__/base.test.ts.snap index c593268eea..d0271d7c5b 100644 --- a/packages/docusaurus/src/webpack/__tests__/__snapshots__/base.test.ts.snap +++ b/packages/docusaurus/src/webpack/__tests__/__snapshots__/base.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`base webpack config creates webpack aliases 1`] = ` -Object { +{ "@docusaurus/BrowserOnly": "../../../../client/exports/BrowserOnly.tsx", "@docusaurus/ComponentCreator": "../../../../client/exports/ComponentCreator.tsx", "@docusaurus/ErrorBoundary": "../../../../client/exports/ErrorBoundary.tsx", @@ -48,7 +48,7 @@ Object { `; exports[`getDocusaurusAliases() returns appropriate webpack aliases 1`] = ` -Object { +{ "@docusaurus/BrowserOnly": "../../client/exports/BrowserOnly.tsx", "@docusaurus/ComponentCreator": "../../client/exports/ComponentCreator.tsx", "@docusaurus/ErrorBoundary": "../../client/exports/ErrorBoundary.tsx",