mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
chore: do not print prototype in jest snapshot (#6908)
This commit is contained in:
parent
3a4b9b4c30
commit
8c1e518ba2
37 changed files with 1536 additions and 1519 deletions
|
@ -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)$': '<rootDir>/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: ['<rootDir>/jest/snapshotPathNormalizer.js'],
|
||||
snapshotFormat: {
|
||||
printBasicPrototype: false,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,68 +1,68 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`error prints objects 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"[31m[1m[ERROR][22m {\\"a\\":1}[39m",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[31m[1m[ERROR][22m undefined[39m",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[31m[1m[ERROR][22m 1,2,3[39m",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[31m[1m[ERROR][22m Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)[39m",
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`info prints objects 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"[36m[1m[INFO][22m[39m {\\"a\\":1}",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[36m[1m[INFO][22m[39m undefined",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[36m[1m[INFO][22m[39m 1,2,3",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[36m[1m[INFO][22m[39m Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)",
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`success prints objects 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"[32m[1m[SUCCESS][22m[39m {\\"a\\":1}",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[32m[1m[SUCCESS][22m[39m undefined",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[32m[1m[SUCCESS][22m[39m 1,2,3",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[32m[1m[SUCCESS][22m[39m Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)",
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`warn prints objects 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"[33m[1m[WARNING][22m {\\"a\\":1}[39m",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[33m[1m[WARNING][22m undefined[39m",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[33m[1m[WARNING][22m 1,2,3[39m",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"[33m[1m[WARNING][22m Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)[39m",
|
||||
],
|
||||
]
|
||||
|
|
|
@ -96,19 +96,19 @@ cmd /C 'set \\"GIT_USER=<GITHUB_USERNAME>\\" && 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 {
|
|||
<span>Test</span>
|
||||
</XYZ>",
|
||||
},
|
||||
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 {
|
|||
<div>Sebastien Lorber</div>
|
||||
</Avatar>",
|
||||
},
|
||||
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 {
|
|||
]}>
|
||||
<TabItem value=\\"bash\\">",
|
||||
},
|
||||
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=<GITHUB_USERNAME> 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": " </TabItem>
|
||||
<TabItem value=\\"windows\\">",
|
||||
},
|
||||
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=<GITHUB_USERNAME>\\" && 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=<GITHUB_USERNAME>\\" && yarn deploy\\"
|
|||
"value": " </TabItem>
|
||||
<TabItem value=\\"powershell\\">",
|
||||
},
|
||||
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=<GITHUB_USERNAME>\\" && yarn deploy\\"
|
|||
"type": "code",
|
||||
"value": "cmd /C 'set \\"GIT_USER=<GITHUB_USERNAME>\\" && 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=<GITHUB_USERNAME>\\" && yarn deploy\\"
|
|||
"value": " </TabItem>
|
||||
</Tabs>",
|
||||
},
|
||||
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=<GITHUB_USERNAME>\\" && 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=<GITHUB_USERNAME>\\" && 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=<GITHUB_USERNAME>\\" && yarn deploy\\"
|
|||
1,
|
||||
1,
|
||||
],
|
||||
"start": Object {
|
||||
"start": {
|
||||
"column": 1,
|
||||
"line": 65,
|
||||
"offset": 1066,
|
||||
|
@ -802,13 +802,13 @@ cmd /C 'set \\"GIT_USER=<GITHUB_USERNAME>\\" && yarn deploy'
|
|||
</Tabs>",
|
||||
},
|
||||
],
|
||||
"position": Object {
|
||||
"end": Object {
|
||||
"position": {
|
||||
"end": {
|
||||
"column": 1,
|
||||
"line": 96,
|
||||
"offset": 1586,
|
||||
},
|
||||
"start": Object {
|
||||
"start": {
|
||||
"column": 1,
|
||||
"line": 1,
|
||||
"offset": 0,
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`migration CLI migrates complex website: copy 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/blog",
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/blog",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/pages/en",
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/src/pages",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/static",
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/static",
|
||||
],
|
||||
|
@ -18,18 +18,18 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`migration CLI migrates complex website: mkdirp 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/src/pages",
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`migration CLI migrates complex website: mkdirs 1`] = `Array []`;
|
||||
exports[`migration CLI migrates complex website: mkdirs 1`] = `[]`;
|
||||
|
||||
exports[`migration CLI migrates complex website: write 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/docusaurus.config.js",
|
||||
"module.exports={
|
||||
\\"title\\": \\"Docusaurus\\",
|
||||
|
@ -138,7 +138,7 @@ Array [
|
|||
}
|
||||
}",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/package.json",
|
||||
"{
|
||||
\\"name\\": \\"docusaurus-1-website\\",
|
||||
|
@ -167,7 +167,7 @@ Array [
|
|||
}
|
||||
}",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_complex_site/src/css/customTheme.css",
|
||||
":root{
|
||||
--ifm-color-primary-lightest: #3CAD6E;
|
||||
|
@ -184,16 +184,16 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`migration CLI migrates missing versions: copy 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/blog",
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/blog",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/pages/en",
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/src/pages",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/static",
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/static",
|
||||
],
|
||||
|
@ -201,18 +201,18 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`migration CLI migrates missing versions: mkdirp 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/src/pages",
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`migration CLI migrates missing versions: mkdirs 1`] = `Array []`;
|
||||
exports[`migration CLI migrates missing versions: mkdirs 1`] = `[]`;
|
||||
|
||||
exports[`migration CLI migrates missing versions: write 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/docusaurus.config.js",
|
||||
"module.exports={
|
||||
\\"title\\": \\"Docusaurus\\",
|
||||
|
@ -321,7 +321,7 @@ Array [
|
|||
}
|
||||
}",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/package.json",
|
||||
"{
|
||||
\\"name\\": \\"docusaurus-1-website\\",
|
||||
|
@ -350,7 +350,7 @@ Array [
|
|||
}
|
||||
}",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_missing_version_site/src/css/customTheme.css",
|
||||
":root{
|
||||
--ifm-color-primary-lightest: #3CAD6E;
|
||||
|
@ -367,12 +367,12 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`migration CLI migrates simple website: copy 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/pages/en",
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/src/pages",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/static",
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/static",
|
||||
],
|
||||
|
@ -380,18 +380,18 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`migration CLI migrates simple website: mkdirp 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/src/pages",
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`migration CLI migrates simple website: mkdirs 1`] = `Array []`;
|
||||
exports[`migration CLI migrates simple website: mkdirs 1`] = `[]`;
|
||||
|
||||
exports[`migration CLI migrates simple website: write 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
[
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/docusaurus.config.js",
|
||||
"module.exports={
|
||||
\\"title\\": \\"Docusaurus\\",
|
||||
|
@ -501,7 +501,7 @@ Array [
|
|||
}
|
||||
}",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/package.json",
|
||||
"{
|
||||
\\"name\\": \\"docusaurus-1-website\\",
|
||||
|
@ -530,7 +530,7 @@ Array [
|
|||
}
|
||||
}",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/migrated_simple_site/src/css/customTheme.css",
|
||||
":root{
|
||||
--ifm-color-primary-lightest: #3CAD6E;
|
||||
|
@ -543,7 +543,7 @@ Array [
|
|||
}
|
||||
",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/docs/api-commands.md",
|
||||
"---
|
||||
id: commands
|
||||
|
@ -552,7 +552,7 @@ title: CLI Commands
|
|||
## Doc
|
||||
",
|
||||
],
|
||||
Array [
|
||||
[
|
||||
"<PROJECT_ROOT>/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/docs/api-doc-markdown.md",
|
||||
"---
|
||||
id: doc-markdown
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`toRedirectFilesMetadata creates appropriate metadata for empty baseUrl: fileContent baseUrl=empty 1`] = `
|
||||
Array [
|
||||
[
|
||||
"<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
@ -17,7 +17,7 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`toRedirectFilesMetadata creates appropriate metadata for root baseUrl: fileContent baseUrl=/ 1`] = `
|
||||
Array [
|
||||
[
|
||||
"<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
@ -33,7 +33,7 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=false: fileContent 1`] = `
|
||||
Array [
|
||||
[
|
||||
"<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
@ -71,7 +71,7 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=true: fileContent 1`] = `
|
||||
Array [
|
||||
[
|
||||
"<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
@ -109,7 +109,7 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`toRedirectFilesMetadata creates appropriate metadata trailingSlash=undefined: fileContent 1`] = `
|
||||
Array [
|
||||
[
|
||||
"<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`atom has feed item for each post 1`] = `
|
||||
Array [
|
||||
[
|
||||
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
|
||||
<feed xmlns=\\"http://www.w3.org/2005/Atom\\">
|
||||
<id>https://docusaurus.io/myBaseUrl/blog</id>
|
||||
|
@ -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 [
|
||||
[
|
||||
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
|
||||
<rss version=\\"2.0\\" xmlns:dc=\\"http://purl.org/dc/elements/1.1/\\" xmlns:content=\\"http://purl.org/rss/1.0/modules/content/\\">
|
||||
<channel>
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -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 () => {
|
||||
|
|
|
@ -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",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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": {},
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -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
|
||||
<!-- highlight-next-line -->
|
||||
dddd",
|
||||
"highlightLines": Array [
|
||||
"highlightLines": [
|
||||
4,
|
||||
],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`parseLines respects language 4`] = `
|
||||
Object {
|
||||
{
|
||||
"code": "aaaa
|
||||
bbbbb
|
||||
ccccc
|
||||
dddd",
|
||||
"highlightLines": Array [
|
||||
"highlightLines": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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('<BrowserOnly>', () => {
|
||||
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('<BrowserOnly>', () => {
|
|||
.toJSON(),
|
||||
).toMatchInlineSnapshot(`
|
||||
<span>
|
||||
https://docusaurus.io
|
||||
https://docusaurus.io/
|
||||
</span>
|
||||
`);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`<Interpolate> acceptance test 1`] = `
|
||||
Array [
|
||||
[
|
||||
"Hello ",
|
||||
"Sébastien",
|
||||
" how are you ",
|
||||
|
@ -13,7 +13,7 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`interpolate acceptance test 1`] = `
|
||||
Array [
|
||||
[
|
||||
<React.Fragment>
|
||||
Hello
|
||||
Sébastien
|
||||
|
@ -31,7 +31,7 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`interpolate placeholders with JSX values 1`] = `
|
||||
Array [
|
||||
[
|
||||
<React.Fragment>
|
||||
Hello
|
||||
<b>
|
||||
|
@ -51,7 +51,7 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`interpolate placeholders with mixed vales 1`] = `
|
||||
Array [
|
||||
[
|
||||
<React.Fragment>
|
||||
Hello
|
||||
Sébastien
|
||||
|
|
|
@ -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": {},
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
"",
|
||||
],
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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": "<link rel=\\"preconnect\\" href=\\"www.google-analytics.com\\">
|
||||
<meta name=\\"generator\\" content=\\"docusaurus\\">",
|
||||
"postBodyTags": "",
|
||||
|
@ -39,7 +39,7 @@ describe('loadHtmlTags', () => {
|
|||
it('only inject preBodyTags', () => {
|
||||
const htmlTags = loadHtmlTags([pluginPreBodyTags()]);
|
||||
expect(htmlTags).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
{
|
||||
"headTags": "",
|
||||
"postBodyTags": "",
|
||||
"preBodyTags": "<script type=\\"text/javascript\\">window.foo = null;</script>",
|
||||
|
@ -50,7 +50,7 @@ describe('loadHtmlTags', () => {
|
|||
it('only inject postBodyTags', () => {
|
||||
const htmlTags = loadHtmlTags([pluginPostBodyTags()]);
|
||||
expect(htmlTags).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
{
|
||||
"headTags": "",
|
||||
"postBodyTags": "<div>Test content</div>",
|
||||
"preBodyTags": "",
|
||||
|
@ -65,7 +65,7 @@ describe('loadHtmlTags', () => {
|
|||
pluginPreBodyTags(),
|
||||
]);
|
||||
expect(htmlTags).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
{
|
||||
"headTags": "<link rel=\\"preconnect\\" href=\\"www.google-analytics.com\\">
|
||||
<meta name=\\"generator\\" content=\\"docusaurus\\">",
|
||||
"postBodyTags": "<div>Test content</div>",
|
||||
|
@ -81,7 +81,7 @@ describe('loadHtmlTags', () => {
|
|||
pluginPostBodyTags(),
|
||||
]);
|
||||
expect(htmlTags).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
{
|
||||
"headTags": "<link rel=\\"preconnect\\" href=\\"www.google-analytics.com\\">
|
||||
<meta name=\\"generator\\" content=\\"docusaurus\\">",
|
||||
"postBodyTags": "<div>Test content</div>",
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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": [],
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -20,9 +20,9 @@ describe('loadPresets', () => {
|
|||
} as LoadContext;
|
||||
const presets = await loadPresets(context);
|
||||
expect(presets).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"plugins": Array [],
|
||||
"themes": Array [],
|
||||
{
|
||||
"plugins": [],
|
||||
"themes": [],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue