@diplodoc/cli-tests 5.24.3 → 5.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -894,3 +894,306 @@ exports[`Alternates > skip-html-extension 13`] = `
894
894
  `;
895
895
 
896
896
  exports[`Alternates > skip-html-extension 14`] = `"window.__DATA__.data.toc = {"href":"ru/","items":[{"href":"ru/about","name":"About","id":"UUID"},{"href":"ru/deep/test","name":"Test","id":"UUID"}],"path":"ru/toc.yaml","id":"UUID"};"`;
897
+
898
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used > filelist 1`] = `
899
+ "[
900
+ ".yfm",
901
+ "az/about.html",
902
+ "az/deep/test.html",
903
+ "az/index.html",
904
+ "az/toc.js",
905
+ "en/about.html",
906
+ "en/deep/test.html",
907
+ "en/index.html",
908
+ "en/toc.js",
909
+ "index.html",
910
+ "ru/about.html",
911
+ "ru/deep/test.html",
912
+ "ru/index.html",
913
+ "ru/toc.js"
914
+ ]"
915
+ `;
916
+
917
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 1`] = `
918
+ "langs: ['ru', 'en', {'lang': 'az', 'tld': 'az'}]
919
+ "
920
+ `;
921
+
922
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 2`] = `
923
+ "<!DOCTYPE html>
924
+ <html lang="az" dir="ltr">
925
+ <head>
926
+ <meta charset="utf-8">
927
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
928
+ <base href="../" />
929
+ <title>About</title>
930
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
931
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
932
+ </head>
933
+ <body class="g-root g-root_theme_light">
934
+ <div id="root"></div>
935
+ <script type="application/json" id="diplodoc-state">
936
+ {"data":{"leading":false,"html":"&lt;p&gt;Content&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"az/about.md"},"headings":[],"title":"About"},"router":{"pathname":"az/about","depth":2,"base":"../"},"lang":"az","langs":["ru","en",{"lang":"az","tld":"az"}],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
937
+ </script>
938
+ <script type="application/javascript">
939
+ const data = document.querySelector('script#diplodoc-state');
940
+ window.__DATA__ = JSON.parse((function unescape(string) {
941
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
942
+ })(data.innerText));
943
+ window.STATIC_CONTENT = false;
944
+ </script>
945
+ <script type="application/javascript" defer src="az/toc.js"></script>
946
+ </body>
947
+ </html>"
948
+ `;
949
+
950
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 3`] = `
951
+ "<!DOCTYPE html>
952
+ <html lang="az" dir="ltr">
953
+ <head>
954
+ <meta charset="utf-8">
955
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
956
+ <base href="../../" />
957
+ <title>Test</title>
958
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
959
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
960
+ </head>
961
+ <body class="g-root g-root_theme_light">
962
+ <div id="root"></div>
963
+ <script type="application/json" id="diplodoc-state">
964
+ {"data":{"leading":false,"html":"&lt;p&gt;Content&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"az/deep/test.md"},"headings":[],"title":"Test"},"router":{"pathname":"az/deep/test","depth":3,"base":"../../"},"lang":"az","langs":["ru","en",{"lang":"az","tld":"az"}],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
965
+ </script>
966
+ <script type="application/javascript">
967
+ const data = document.querySelector('script#diplodoc-state');
968
+ window.__DATA__ = JSON.parse((function unescape(string) {
969
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
970
+ })(data.innerText));
971
+ window.STATIC_CONTENT = false;
972
+ </script>
973
+ <script type="application/javascript" defer src="az/toc.js"></script>
974
+ </body>
975
+ </html>"
976
+ `;
977
+
978
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 4`] = `
979
+ "<!DOCTYPE html>
980
+ <html lang="az" dir="ltr">
981
+ <head>
982
+ <meta charset="utf-8">
983
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
984
+ <base href="../" />
985
+ <title></title>
986
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
987
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
988
+ </head>
989
+ <body class="g-root g-root_theme_light">
990
+ <div id="root"></div>
991
+ <script type="application/json" id="diplodoc-state">
992
+ {"data":{"leading":true,"data":{"links":[{"url":"az/about/index.html","name":"About"}]},"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"az/index.yaml"},"title":""},"router":{"pathname":"az/index","depth":2,"base":"../"},"lang":"az","langs":["ru","en",{"lang":"az","tld":"az"}],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
993
+ </script>
994
+ <script type="application/javascript">
995
+ const data = document.querySelector('script#diplodoc-state');
996
+ window.__DATA__ = JSON.parse((function unescape(string) {
997
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
998
+ })(data.innerText));
999
+ window.STATIC_CONTENT = false;
1000
+ </script>
1001
+ <script type="application/javascript" defer src="az/toc.js"></script>
1002
+ </body>
1003
+ </html>"
1004
+ `;
1005
+
1006
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 5`] = `"window.__DATA__.data.toc = {"href":"az/index.html","items":[{"href":"az/about.html","name":"About","id":"UUID"},{"href":"az/deep/test.html","name":"Test","id":"UUID"}],"path":"az/toc.yaml","id":"UUID"};"`;
1007
+
1008
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 6`] = `
1009
+ "<!DOCTYPE html>
1010
+ <html lang="en" dir="ltr">
1011
+ <head>
1012
+ <meta charset="utf-8">
1013
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1014
+ <base href="../" />
1015
+ <title>About</title>
1016
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
1017
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
1018
+ </head>
1019
+ <body class="g-root g-root_theme_light">
1020
+ <div id="root"></div>
1021
+ <script type="application/json" id="diplodoc-state">
1022
+ {"data":{"leading":false,"html":"&lt;p&gt;Content&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"en/about.md"},"headings":[],"title":"About"},"router":{"pathname":"en/about","depth":2,"base":"../"},"lang":"en","langs":["ru","en",{"lang":"az","tld":"az"}],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
1023
+ </script>
1024
+ <script type="application/javascript">
1025
+ const data = document.querySelector('script#diplodoc-state');
1026
+ window.__DATA__ = JSON.parse((function unescape(string) {
1027
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
1028
+ })(data.innerText));
1029
+ window.STATIC_CONTENT = false;
1030
+ </script>
1031
+ <script type="application/javascript" defer src="en/toc.js"></script>
1032
+ </body>
1033
+ </html>"
1034
+ `;
1035
+
1036
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 7`] = `
1037
+ "<!DOCTYPE html>
1038
+ <html lang="en" dir="ltr">
1039
+ <head>
1040
+ <meta charset="utf-8">
1041
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1042
+ <base href="../../" />
1043
+ <title>Test</title>
1044
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
1045
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
1046
+ </head>
1047
+ <body class="g-root g-root_theme_light">
1048
+ <div id="root"></div>
1049
+ <script type="application/json" id="diplodoc-state">
1050
+ {"data":{"leading":false,"html":"&lt;p&gt;Content&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"en/deep/test.md"},"headings":[],"title":"Test"},"router":{"pathname":"en/deep/test","depth":3,"base":"../../"},"lang":"en","langs":["ru","en",{"lang":"az","tld":"az"}],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
1051
+ </script>
1052
+ <script type="application/javascript">
1053
+ const data = document.querySelector('script#diplodoc-state');
1054
+ window.__DATA__ = JSON.parse((function unescape(string) {
1055
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
1056
+ })(data.innerText));
1057
+ window.STATIC_CONTENT = false;
1058
+ </script>
1059
+ <script type="application/javascript" defer src="en/toc.js"></script>
1060
+ </body>
1061
+ </html>"
1062
+ `;
1063
+
1064
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 8`] = `
1065
+ "<!DOCTYPE html>
1066
+ <html lang="en" dir="ltr">
1067
+ <head>
1068
+ <meta charset="utf-8">
1069
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1070
+ <base href="../" />
1071
+ <title></title>
1072
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
1073
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
1074
+ </head>
1075
+ <body class="g-root g-root_theme_light">
1076
+ <div id="root"></div>
1077
+ <script type="application/json" id="diplodoc-state">
1078
+ {"data":{"leading":true,"data":{"links":[{"url":"en/about/index.html","name":"About"}]},"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"en/index.yaml"},"title":""},"router":{"pathname":"en/index","depth":2,"base":"../"},"lang":"en","langs":["ru","en",{"lang":"az","tld":"az"}],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
1079
+ </script>
1080
+ <script type="application/javascript">
1081
+ const data = document.querySelector('script#diplodoc-state');
1082
+ window.__DATA__ = JSON.parse((function unescape(string) {
1083
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
1084
+ })(data.innerText));
1085
+ window.STATIC_CONTENT = false;
1086
+ </script>
1087
+ <script type="application/javascript" defer src="en/toc.js"></script>
1088
+ </body>
1089
+ </html>"
1090
+ `;
1091
+
1092
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 9`] = `"window.__DATA__.data.toc = {"href":"en/index.html","items":[{"href":"en/about.html","name":"About","id":"UUID"},{"href":"en/deep/test.html","name":"Test","id":"UUID"}],"path":"en/toc.yaml","id":"UUID"};"`;
1093
+
1094
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 10`] = `
1095
+ "<!DOCTYPE html>
1096
+ <html lang="ru" dir="ltr">
1097
+ <head>
1098
+ <meta charset="utf-8">
1099
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1100
+ <base href="./" />
1101
+ <title>Redirect to ./ru/index.html</title>
1102
+ <meta http-equiv="refresh" content="0; url=./ru/index.html">
1103
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
1104
+ <script type="application/javascript">
1105
+ window.location.replace("./ru/index.html");
1106
+ </script>
1107
+ </head>
1108
+ <body class="g-root g-root_theme_light">
1109
+ If you are not redirected automatically, follow this <a href="./ru/index.html">link</a>.
1110
+ </body>
1111
+ </html>"
1112
+ `;
1113
+
1114
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 11`] = `
1115
+ "<!DOCTYPE html>
1116
+ <html lang="ru" dir="ltr">
1117
+ <head>
1118
+ <meta charset="utf-8">
1119
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1120
+ <base href="../" />
1121
+ <title>About</title>
1122
+ <link rel="alternate" href="https://my-other-site.com/about" />
1123
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
1124
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
1125
+ </head>
1126
+ <body class="g-root g-root_theme_light">
1127
+ <div id="root"></div>
1128
+ <script type="application/json" id="diplodoc-state">
1129
+ {"data":{"leading":false,"html":"&lt;p&gt;Content&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"alternate":[{"href":"https://my-other-site.com/about"}],"vcsPath":"ru/about.md"},"headings":[],"title":"About"},"router":{"pathname":"ru/about","depth":2,"base":"../"},"lang":"ru","langs":["ru","en",{"lang":"az","tld":"az"}],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
1130
+ </script>
1131
+ <script type="application/javascript">
1132
+ const data = document.querySelector('script#diplodoc-state');
1133
+ window.__DATA__ = JSON.parse((function unescape(string) {
1134
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
1135
+ })(data.innerText));
1136
+ window.STATIC_CONTENT = false;
1137
+ </script>
1138
+ <script type="application/javascript" defer src="ru/toc.js"></script>
1139
+ </body>
1140
+ </html>"
1141
+ `;
1142
+
1143
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 12`] = `
1144
+ "<!DOCTYPE html>
1145
+ <html lang="ru" dir="ltr">
1146
+ <head>
1147
+ <meta charset="utf-8">
1148
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1149
+ <base href="../../" />
1150
+ <title>Test</title>
1151
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
1152
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
1153
+ </head>
1154
+ <body class="g-root g-root_theme_light">
1155
+ <div id="root"></div>
1156
+ <script type="application/json" id="diplodoc-state">
1157
+ {"data":{"leading":false,"html":"&lt;p&gt;Content&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"ru/deep/test.md"},"headings":[],"title":"Test"},"router":{"pathname":"ru/deep/test","depth":3,"base":"../../"},"lang":"ru","langs":["ru","en",{"lang":"az","tld":"az"}],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
1158
+ </script>
1159
+ <script type="application/javascript">
1160
+ const data = document.querySelector('script#diplodoc-state');
1161
+ window.__DATA__ = JSON.parse((function unescape(string) {
1162
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
1163
+ })(data.innerText));
1164
+ window.STATIC_CONTENT = false;
1165
+ </script>
1166
+ <script type="application/javascript" defer src="ru/toc.js"></script>
1167
+ </body>
1168
+ </html>"
1169
+ `;
1170
+
1171
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 13`] = `
1172
+ "<!DOCTYPE html>
1173
+ <html lang="ru" dir="ltr">
1174
+ <head>
1175
+ <meta charset="utf-8">
1176
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1177
+ <base href="../" />
1178
+ <title></title>
1179
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
1180
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
1181
+ </head>
1182
+ <body class="g-root g-root_theme_light">
1183
+ <div id="root"></div>
1184
+ <script type="application/json" id="diplodoc-state">
1185
+ {"data":{"leading":true,"data":{"links":[{"url":"ru/about/index.html","name":"About"}]},"meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"ru/index.yaml"},"title":""},"router":{"pathname":"ru/index","depth":2,"base":"../"},"lang":"ru","langs":["ru","en",{"lang":"az","tld":"az"}],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
1186
+ </script>
1187
+ <script type="application/javascript">
1188
+ const data = document.querySelector('script#diplodoc-state');
1189
+ window.__DATA__ = JSON.parse((function unescape(string) {
1190
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
1191
+ })(data.innerText));
1192
+ window.STATIC_CONTENT = false;
1193
+ </script>
1194
+ <script type="application/javascript" defer src="ru/toc.js"></script>
1195
+ </body>
1196
+ </html>"
1197
+ `;
1198
+
1199
+ exports[`Alternates with --no-add-alternate-meta > should not add alternate meta tags when --no-add-alternate-meta is used 14`] = `"window.__DATA__.data.toc = {"href":"ru/index.html","items":[{"href":"ru/about.html","name":"About","id":"UUID"},{"href":"ru/deep/test.html","name":"Test","id":"UUID"}],"path":"ru/toc.yaml","id":"UUID"};"`;
@@ -33,3 +33,17 @@ describe('Alternates', () => {
33
33
  await compareDirectories(outputPath + '-html');
34
34
  });
35
35
  });
36
+
37
+ describe('Alternates with --no-add-alternate-meta', () => {
38
+ it('should not add alternate meta tags when --no-add-alternate-meta is used', async () => {
39
+ const {inputPath, outputPath} = getTestPaths('mocks/alternates');
40
+
41
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
42
+ md2md: false,
43
+ md2html: true,
44
+ args: '-j2 --no-add-alternate-meta',
45
+ });
46
+
47
+ await compareDirectories(outputPath);
48
+ });
49
+ });
@@ -28,6 +28,8 @@ export class BinaryRunner implements Runner {
28
28
  // eslint-disable-next-line no-console
29
29
  console.log(line);
30
30
  }
31
+ } else if (report.code > 0) {
32
+ console.error(stderr);
31
33
  }
32
34
 
33
35
  return report;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.24.3",
3
+ "version": "5.25.0",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },