@diplodoc/cli-tests 0.0.0-rc-reusable-e2es-202504041505 → 4.59.1

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.
Files changed (37) hide show
  1. package/bin.mjs +3 -7
  2. package/e2e/__snapshots__/load-custom-resources.spec.ts.snap +4 -4
  3. package/e2e/__snapshots__/metadata.spec.ts.snap +2 -2
  4. package/e2e/__snapshots__/regression.test.ts.snap +13 -13
  5. package/e2e/__snapshots__/rtl.spec.ts.snap +3 -3
  6. package/e2e/__snapshots__/translation.spec.ts.snap +426 -0
  7. package/e2e/generate-map.spec.ts +2 -5
  8. package/e2e/include-toc.test.ts +15 -18
  9. package/e2e/load-custom-resources.spec.ts +3 -6
  10. package/e2e/metadata.spec.ts +3 -6
  11. package/e2e/plugin-corner-cases.spec.ts +3 -6
  12. package/e2e/regression.test.ts +7 -10
  13. package/e2e/rtl.spec.ts +3 -6
  14. package/e2e/translation.spec.ts +55 -0
  15. package/fixtures/cliAdapter.ts +47 -7
  16. package/fixtures/runners/binary.ts +5 -19
  17. package/fixtures/runners/source.ts +4 -9
  18. package/fixtures/utils/file.ts +23 -16
  19. package/fixtures/utils/test.ts +1 -1
  20. package/mocks/translation/dir-files/input/ru/_includes/test.md +1 -0
  21. package/mocks/translation/dir-files/input/ru/_no-translate/exclude.md +1 -0
  22. package/mocks/translation/dir-files/input/ru/aboba.md +7 -0
  23. package/mocks/translation/dir-files/input/ru/index.md +3 -0
  24. package/mocks/translation/dir-files/input/ru/nested/index-yfm.md +2 -0
  25. package/mocks/translation/dir-files/input/ru/nested/index.yaml +24 -0
  26. package/mocks/translation/dir-files/input/ru/nested/not-in-toc.md +20 -0
  27. package/mocks/translation/dir-files/input/ru/nested/syntax/base.md +1 -0
  28. package/mocks/translation/dir-files/input/ru/nested/syntax/index.md +2 -0
  29. package/mocks/translation/dir-files/input/ru/nested/syntax/lists.md +1 -0
  30. package/mocks/translation/dir-files/input/ru/nested/toc.yaml +18 -0
  31. package/mocks/translation/dir-files/input/ru/not-in-toc.md +20 -0
  32. package/mocks/translation/dir-files/input/ru/toc.yaml +7 -0
  33. package/mocks/translation/yaml-scheme/input/ru/.yfm +1 -0
  34. package/mocks/translation/yaml-scheme/input/ru/index-direct.yaml +133 -0
  35. package/mocks/translation/yaml-scheme/input/ru/index.yaml +32 -0
  36. package/mocks/translation/yaml-scheme/input/ru/toc.yaml +19 -0
  37. package/package.json +7 -5
@@ -0,0 +1,426 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`Translate command > extract yaml scheme files > en/index.yaml.skl 1`] = `
4
+ "blocks:
5
+ - type: content-layout-block
6
+ textWidth: l
7
+ textContent:
8
+ title: '%%%0%%%'
9
+ text: |2-
10
+ %%%1%%%
11
+ - %%%2%%%
12
+ - %%%3%%%
13
+
14
+ - type: card-layout-block
15
+ colSizes:
16
+ all: 12
17
+ lg: 4
18
+ md: 6
19
+ sm: 12
20
+ xl: 4
21
+ indent:
22
+ bottom: xs
23
+ title: '%%%4%%%'
24
+ animated: false
25
+ children:
26
+ - type: basic-card
27
+ title: '%%%5%%%'
28
+ text: '%%%6%%%'
29
+ urlTitle: '%%%7%%%'
30
+ border: shadow
31
+ controlPosition: content
32
+ url: management/index
33
+ target: ''
34
+ animated: false
35
+ "
36
+ `;
37
+
38
+ exports[`Translate command > extract yaml scheme files > en/index.yaml.xliff 1`] = `
39
+ "<?xml version="1.0" encoding="UTF-8"?>
40
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
41
+ <file original="file.ext" source-language="ru-RU" target-language="en-US" datatype="markdown">
42
+ <header>
43
+ <skeleton>
44
+ <external-file href="file.skl"></external-file>
45
+ </skeleton>
46
+ </header>
47
+ <body>
48
+ <trans-unit id="0">
49
+ <source xml:space="preserve">Введение</source>
50
+ </trans-unit>
51
+ <trans-unit id="1">
52
+ <source xml:space="preserve">API сервиса: - Управлять счетчиками, их настройками и правами доступа, не используя веб-интерфейс.</source>
53
+ </trans-unit>
54
+ <trans-unit id="2">
55
+ <source xml:space="preserve">Получать информацию о посещаемости сайта и другие данные.</source>
56
+ </trans-unit>
57
+ <trans-unit id="3">
58
+ <source xml:space="preserve">Формировать отчеты, в том числе с помощью сегментации и параметризации.</source>
59
+ </trans-unit>
60
+ <trans-unit id="4">
61
+ <source xml:space="preserve">Виды API</source>
62
+ </trans-unit>
63
+ <trans-unit id="5">
64
+ <source xml:space="preserve">API управления</source>
65
+ </trans-unit>
66
+ <trans-unit id="6">
67
+ <source xml:space="preserve">Управление счетчиками, целями, фильтрами и другими объектами Сервиса (например, создать счетчик, отредактировать его настройки, создать цель, выдать права доступа).</source>
68
+ </trans-unit>
69
+ <trans-unit id="7">
70
+ <source xml:space="preserve">API управления</source>
71
+ </trans-unit>
72
+ </body>
73
+ </file>
74
+ </xliff>"
75
+ `;
76
+
77
+ exports[`Translate command > extract yaml scheme files > en/index-direct.yaml.skl 1`] = `
78
+ "meta:
79
+ title: '%%%0%%%'
80
+ description: '%%%1%%%'
81
+ fullScreen: true
82
+ blocks:
83
+ - type: header-block
84
+ title: <div class="u-breadcrumbs"></div>
85
+ breadcrumbs:
86
+ items:
87
+ - text: '%%%2%%%'
88
+ url: https://site.ru/support/
89
+ - text: '%%%3%%%'
90
+ url: https://site.ru/support/adv/
91
+ - type: filter-block
92
+ centered: false
93
+ title:
94
+ text: '%%%4%%%'
95
+ tags:
96
+ - id: one
97
+ label: '%%%5%%%'
98
+ - id: two
99
+ label: '%%%6%%%'
100
+ colSizes:
101
+ all: 12
102
+ xl: 4
103
+ sm: 6
104
+ md: 4
105
+ items:
106
+ - tags:
107
+ - one
108
+ card:
109
+ type: image-card
110
+ image: https://site.ru/img/orig
111
+ title: '%%%7%%%'
112
+ text: <div>%%%8%%%</div><div class="u-card__more">%%%9%%%
113
+ margins: m
114
+ border: shadow
115
+ url: unified-performance-campaign/about.md
116
+ urlTitle: '%%%10%%%'
117
+ - tags:
118
+ - one
119
+ card:
120
+ type: image-card
121
+ image: https://site.ru/img2/orig
122
+ title: '%%%11%%%'
123
+ text: <div>%%%12%%%</div><div class="u-card__more">%%%13%%%
124
+ margins: m
125
+ border: shadow
126
+ url: campaign-master/product-campaign.md
127
+ urlTitle: '%%%14%%%'
128
+ - tags:
129
+ - one
130
+ card:
131
+ type: image-card
132
+ image: https://site.ru/img2/orig
133
+ title: '%%%15%%%'
134
+ text: <div>%%%16%%%</div><div class="u-card__more">%%%17%%%
135
+ margins: m
136
+ border: shadow
137
+ url: efficiency/telegram-ads.md
138
+ urlTitle: '%%%18%%%'
139
+ - tags:
140
+ - one
141
+ card:
142
+ type: background-card
143
+ title: '%%%19%%%'
144
+ text: ''
145
+ backgroundColor: '#F3F6FC'
146
+ border: line
147
+ links:
148
+ - text: '%%%20%%%'
149
+ url: statistics.md
150
+ arrow: true
151
+ theme: normal
152
+ - text: '%%%21%%%'
153
+ url: feeds/about.md
154
+ arrow: true
155
+ theme: normal
156
+ - tags:
157
+ - one
158
+ card:
159
+ type: background-card
160
+ title: '%%%22%%%'
161
+ text: ''
162
+ backgroundColor: '#F3F6FC'
163
+ border: line
164
+ links:
165
+ - text: '%%%23%%%'
166
+ url: moderation/adv-rules.md
167
+ arrow: true
168
+ theme: normal
169
+ - text: '%%%24%%%'
170
+ url: technologies-and-services/technologies-and-services.md
171
+ arrow: true
172
+ theme: normal
173
+ - text: '%%%25%%%'
174
+ url: troubleshooting/other.md
175
+ arrow: true
176
+ theme: normal
177
+ - tags:
178
+ - one
179
+ card:
180
+ type: background-card
181
+ title: '%%%26%%%'
182
+ text: ''
183
+ backgroundColor: '#F3F6FC'
184
+ border: line
185
+ links:
186
+ - text: '%%%27%%%'
187
+ url: glossary.md
188
+ arrow: true
189
+ theme: normal
190
+ - tags:
191
+ - two
192
+ card:
193
+ type: image-card
194
+ image: https://site.ru/img4/orig
195
+ title: '%%%28%%%'
196
+ text: <div>%%%29%%%</div><div class="u-card__more">%%%30%%%
197
+ margins: m
198
+ border: shadow
199
+ url: products-automatic/about.md
200
+ urlTitle: '%%%31%%%'
201
+ animated: false
202
+ "
203
+ `;
204
+
205
+ exports[`Translate command > extract yaml scheme files > en/index-direct.yaml.xliff 1`] = `
206
+ "<?xml version="1.0" encoding="UTF-8"?>
207
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
208
+ <file original="file.ext" source-language="ru-RU" target-language="en-US" datatype="markdown">
209
+ <header>
210
+ <skeleton>
211
+ <external-file href="file.skl"></external-file>
212
+ </skeleton>
213
+ </header>
214
+ <body>
215
+ <trans-unit id="0">
216
+ <source xml:space="preserve">Справка Сервиса</source>
217
+ </trans-unit>
218
+ <trans-unit id="1">
219
+ <source xml:space="preserve">В Справке Сервиса собрали всю необходимую информацию.</source>
220
+ </trans-unit>
221
+ <trans-unit id="2">
222
+ <source xml:space="preserve">Справка</source>
223
+ </trans-unit>
224
+ <trans-unit id="3">
225
+ <source xml:space="preserve">Реклама</source>
226
+ </trans-unit>
227
+ <trans-unit id="4">
228
+ <source xml:space="preserve">Сервис</source>
229
+ </trans-unit>
230
+ <trans-unit id="5">
231
+ <source xml:space="preserve">Для специалистов</source>
232
+ </trans-unit>
233
+ <trans-unit id="6">
234
+ <source xml:space="preserve">Для предпринимателей</source>
235
+ </trans-unit>
236
+ <trans-unit id="7">
237
+ <source xml:space="preserve">Единая перфоманс-кампания</source>
238
+ </trans-unit>
239
+ <trans-unit id="8">
240
+ <source xml:space="preserve">Комплексно решайте любые перфоманс-задачи в рамках одной кампании</source>
241
+ </trans-unit>
242
+ <trans-unit id="9">
243
+ <source xml:space="preserve">Подробнее&lt;/&gt;</source>
244
+ </trans-unit>
245
+ <trans-unit id="10">
246
+ <source xml:space="preserve">Подробнее</source>
247
+ </trans-unit>
248
+ <trans-unit id="11">
249
+ <source xml:space="preserve">Товарная кампания</source>
250
+ </trans-unit>
251
+ <trans-unit id="12">
252
+ <source xml:space="preserve">Используйте простой инструмент для продвижения товаров интернете</source>
253
+ </trans-unit>
254
+ <trans-unit id="13">
255
+ <source xml:space="preserve">Подробнее&lt;/&gt;</source>
256
+ </trans-unit>
257
+ <trans-unit id="14">
258
+ <source xml:space="preserve">Подробнее</source>
259
+ </trans-unit>
260
+ <trans-unit id="15">
261
+ <source xml:space="preserve">Реклама в Telegram</source>
262
+ </trans-unit>
263
+ <trans-unit id="16">
264
+ <source xml:space="preserve">Покажите релевантную рекламу в телеграм-каналах партнеров РСЯ</source>
265
+ </trans-unit>
266
+ <trans-unit id="17">
267
+ <source xml:space="preserve">Подробнее&lt;/&gt;</source>
268
+ </trans-unit>
269
+ <trans-unit id="18">
270
+ <source xml:space="preserve">Подробнее</source>
271
+ </trans-unit>
272
+ <trans-unit id="19">
273
+ <source xml:space="preserve">Часто ищут</source>
274
+ </trans-unit>
275
+ <trans-unit id="20">
276
+ <source xml:space="preserve">Статистика</source>
277
+ </trans-unit>
278
+ <trans-unit id="21">
279
+ <source xml:space="preserve">Управление фидами</source>
280
+ </trans-unit>
281
+ <trans-unit id="22">
282
+ <source xml:space="preserve">Сервисные функции</source>
283
+ </trans-unit>
284
+ <trans-unit id="23">
285
+ <source xml:space="preserve">Правила и модерация</source>
286
+ </trans-unit>
287
+ <trans-unit id="24">
288
+ <source xml:space="preserve">Технологии и сервисы</source>
289
+ </trans-unit>
290
+ <trans-unit id="25">
291
+ <source xml:space="preserve">Поддержка 24/7</source>
292
+ </trans-unit>
293
+ <trans-unit id="26">
294
+ <source xml:space="preserve">Полезные ссылки</source>
295
+ </trans-unit>
296
+ <trans-unit id="27">
297
+ <source xml:space="preserve">Глоссарий</source>
298
+ </trans-unit>
299
+ <trans-unit id="28">
300
+ <source xml:space="preserve">Простой старт</source>
301
+ </trans-unit>
302
+ <trans-unit id="29">
303
+ <source xml:space="preserve">Минимум ручных настроек: достаточно указать ссылку на сайт</source>
304
+ </trans-unit>
305
+ <trans-unit id="30">
306
+ <source xml:space="preserve">Подробнее&lt;/&gt;</source>
307
+ </trans-unit>
308
+ <trans-unit id="31">
309
+ <source xml:space="preserve">Подробнее</source>
310
+ </trans-unit>
311
+ </body>
312
+ </file>
313
+ </xliff>"
314
+ `;
315
+
316
+ exports[`Translate command > extract yaml scheme files > en/toc.yaml.skl 1`] = `
317
+ "title: '%%%0%%%'
318
+ href: index.yaml
319
+ items:
320
+ - name: '%%%4%%%'
321
+ - href: index-direct.yaml
322
+ navigation:
323
+ header:
324
+ leftItems:
325
+ - text: '%%%2%%%'
326
+ type: dropdown
327
+ items:
328
+ - text: '%%%3%%%'
329
+ type: link
330
+ href: menu/item
331
+ logo:
332
+ light:
333
+ icon: https://icon.link/logo.svg
334
+ url: https://site.ru
335
+ urlTitle: '%%%1%%%'
336
+ "
337
+ `;
338
+
339
+ exports[`Translate command > extract yaml scheme files > en/toc.yaml.xliff 1`] = `
340
+ "<?xml version="1.0" encoding="UTF-8"?>
341
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
342
+ <file original="file.ext" source-language="ru-RU" target-language="en-US" datatype="markdown">
343
+ <header>
344
+ <skeleton>
345
+ <external-file href="file.skl"></external-file>
346
+ </skeleton>
347
+ </header>
348
+ <body>
349
+ <trans-unit id="0">
350
+ <source xml:space="preserve">Заголовок</source>
351
+ </trans-unit>
352
+ <trans-unit id="1">
353
+ <source xml:space="preserve">На сайт сервиса</source>
354
+ </trans-unit>
355
+ <trans-unit id="2">
356
+ <source xml:space="preserve">Инструменты</source>
357
+ </trans-unit>
358
+ <trans-unit id="3">
359
+ <source xml:space="preserve">Пункт меню</source>
360
+ </trans-unit>
361
+ <trans-unit id="4">
362
+ <source xml:space="preserve">Дочерняя страница</source>
363
+ </trans-unit>
364
+ </body>
365
+ </file>
366
+ </xliff>"
367
+ `;
368
+
369
+ exports[`Translate command > extract yaml scheme files > filelist 1`] = `
370
+ "[
371
+ "en/index-direct.yaml.skl",
372
+ "en/index-direct.yaml.xliff",
373
+ "en/index.yaml.skl",
374
+ "en/index.yaml.xliff",
375
+ "en/toc.yaml.skl",
376
+ "en/toc.yaml.xliff"
377
+ ]"
378
+ `;
379
+
380
+ exports[`Translate command > filter files on extract > filelist 1`] = `
381
+ "[
382
+ "es/_includes/test.md.skl",
383
+ "es/_includes/test.md.xliff",
384
+ "es/_no-translate/exclude.md.skl",
385
+ "es/_no-translate/exclude.md.xliff",
386
+ "es/aboba.md.skl",
387
+ "es/aboba.md.xliff",
388
+ "es/index.md.skl",
389
+ "es/index.md.xliff",
390
+ "es/nested/index-yfm.md.skl",
391
+ "es/nested/index-yfm.md.xliff",
392
+ "es/nested/index.yaml.skl",
393
+ "es/nested/index.yaml.xliff",
394
+ "es/nested/syntax/base.md.skl",
395
+ "es/nested/syntax/base.md.xliff",
396
+ "es/nested/syntax/lists.md.skl",
397
+ "es/nested/syntax/lists.md.xliff",
398
+ "es/nested/toc.yaml.skl",
399
+ "es/nested/toc.yaml.xliff",
400
+ "es/toc.yaml.skl",
401
+ "es/toc.yaml.xliff"
402
+ ]"
403
+ `;
404
+
405
+ exports[`Translate command > filter files on extract with extra exclude option > filelist 1`] = `
406
+ "[
407
+ "es/_includes/test.md.skl",
408
+ "es/_includes/test.md.xliff",
409
+ "es/aboba.md.skl",
410
+ "es/aboba.md.xliff",
411
+ "es/index.md.skl",
412
+ "es/index.md.xliff",
413
+ "es/nested/index-yfm.md.skl",
414
+ "es/nested/index-yfm.md.xliff",
415
+ "es/nested/index.yaml.skl",
416
+ "es/nested/index.yaml.xliff",
417
+ "es/nested/syntax/base.md.skl",
418
+ "es/nested/syntax/base.md.xliff",
419
+ "es/nested/syntax/lists.md.skl",
420
+ "es/nested/syntax/lists.md.xliff",
421
+ "es/nested/toc.yaml.skl",
422
+ "es/nested/toc.yaml.xliff",
423
+ "es/toc.yaml.skl",
424
+ "es/toc.yaml.xliff"
425
+ ]"
426
+ `;
@@ -1,7 +1,6 @@
1
1
  import {describe, expect, test} from 'vitest';
2
- import {bundleless, getFileContent, getTestPaths} from '../fixtures';
2
+ import {TestAdapter, bundleless, getFileContent, getTestPaths} from '../fixtures';
3
3
  import {join} from 'path';
4
- import {CliTestAdapter} from '../fixtures/cliAdapter';
5
4
 
6
5
  const generateMapTestTemplate = (
7
6
  testTitle: string,
@@ -9,12 +8,10 @@ const generateMapTestTemplate = (
9
8
  md2md = true,
10
9
  md2html = true,
11
10
  ) => {
12
- const cliTestAdapter = new CliTestAdapter();
13
-
14
11
  test(testTitle, async () => {
15
12
  const {inputPath, outputPath} = getTestPaths(testRootPath);
16
13
 
17
- await cliTestAdapter.testPass(inputPath, outputPath, {md2md, md2html, args: '--add-map-file'});
14
+ await TestAdapter.testBuildPass(inputPath, outputPath, {md2md, md2html, args: '--add-map-file'});
18
15
 
19
16
  const content = getFileContent(join(outputPath, 'files.json'));
20
17
 
@@ -1,32 +1,29 @@
1
1
  import {describe, test} from 'vitest';
2
- import {compareDirectories, getTestPaths} from '../fixtures';
3
- import {CliTestAdapter} from '../fixtures/cliAdapter';
2
+ import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
4
3
 
5
4
  describe('Include toc', () => {
6
- const cliTestAdapter = new CliTestAdapter();
7
-
8
5
  test('Toc is included in link mode', async () => {
9
6
  const {inputPath, outputPath} = getTestPaths('mocks/include-toc/test1');
10
- await cliTestAdapter.testPass(inputPath, outputPath);
11
- compareDirectories(outputPath);
7
+ await TestAdapter.testBuildPass(inputPath, outputPath);
8
+ await compareDirectories(outputPath);
12
9
  });
13
10
 
14
11
  test('Toc is included inline, not as a new section', async () => {
15
12
  const {inputPath, outputPath} = getTestPaths('mocks/include-toc/test2');
16
- await cliTestAdapter.testPass(inputPath, outputPath);
17
- compareDirectories(outputPath);
13
+ await TestAdapter.testBuildPass(inputPath, outputPath);
14
+ await compareDirectories(outputPath);
18
15
  });
19
16
 
20
17
  test('Nested toc inclusions with mixed including modes', async () => {
21
18
  const {inputPath, outputPath} = getTestPaths('mocks/include-toc/test3');
22
- await cliTestAdapter.testPass(inputPath, outputPath);
23
- compareDirectories(outputPath);
19
+ await TestAdapter.testBuildPass(inputPath, outputPath);
20
+ await compareDirectories(outputPath);
24
21
  });
25
22
 
26
23
  test('Nested toc inclusions with mixed including modes 2', async () => {
27
24
  const {inputPath, outputPath} = getTestPaths('mocks/include-toc/test5');
28
- await cliTestAdapter.testPass(inputPath, outputPath);
29
- compareDirectories(outputPath);
25
+ await TestAdapter.testBuildPass(inputPath, outputPath);
26
+ await compareDirectories(outputPath);
30
27
  });
31
28
 
32
29
  test('Toc with expressions', async () => {
@@ -37,21 +34,21 @@ describe('Include toc', () => {
37
34
  b: 'B',
38
35
  };
39
36
 
40
- await cliTestAdapter.testPass(inputPath, outputPath, {
37
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
41
38
  args: `--vars=${JSON.stringify(vars)}`,
42
39
  });
43
- compareDirectories(outputPath);
40
+ await compareDirectories(outputPath);
44
41
  });
45
42
 
46
43
  test('Toc with generic includer', async () => {
47
44
  const {inputPath, outputPath} = getTestPaths('mocks/include-toc/test6');
48
- await cliTestAdapter.testPass(inputPath, outputPath);
49
- compareDirectories(outputPath);
45
+ await TestAdapter.testBuildPass(inputPath, outputPath);
46
+ await compareDirectories(outputPath);
50
47
  });
51
48
 
52
49
  test('Toc root merge on non root dir', async () => {
53
50
  const {inputPath, outputPath} = getTestPaths('mocks/include-toc/test7');
54
- await cliTestAdapter.testPass(inputPath, outputPath);
55
- compareDirectories(outputPath);
51
+ await TestAdapter.testBuildPass(inputPath, outputPath);
52
+ await compareDirectories(outputPath);
56
53
  });
57
54
  });
@@ -1,18 +1,15 @@
1
1
  import {describe, test} from 'vitest';
2
- import {compareDirectories, getTestPaths} from '../fixtures';
3
- import {CliTestAdapter} from '../fixtures/cliAdapter';
2
+ import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
4
3
 
5
4
  const generateMapTestTemplate = (
6
5
  testTitle: string,
7
6
  testRootPath: string,
8
7
  {md2md = true, md2html = true, args = '--allow-custom-resources'},
9
8
  ) => {
10
- const cliTestAdapter = new CliTestAdapter();
11
-
12
9
  test(testTitle, async () => {
13
10
  const {inputPath, outputPath} = getTestPaths(testRootPath);
14
- await cliTestAdapter.testPass(inputPath, outputPath, {md2md, md2html, args});
15
- compareDirectories(outputPath);
11
+ await TestAdapter.testBuildPass(inputPath, outputPath, {md2md, md2html, args});
12
+ await compareDirectories(outputPath);
16
13
  });
17
14
  };
18
15
 
@@ -1,18 +1,15 @@
1
1
  import {describe, test} from 'vitest';
2
- import {compareDirectories, getTestPaths} from '../fixtures';
3
- import {CliTestAdapter} from '../fixtures/cliAdapter';
2
+ import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
4
3
 
5
4
  const generateMapTestTemplate = (
6
5
  testTitle: string,
7
6
  testRootPath: string,
8
7
  {md2md = true, md2html = true},
9
8
  ) => {
10
- const cliTestAdapter = new CliTestAdapter();
11
-
12
9
  test(testTitle, async () => {
13
10
  const {inputPath, outputPath} = getTestPaths(testRootPath);
14
- await cliTestAdapter.testPass(inputPath, outputPath, {md2md, md2html});
15
- compareDirectories(outputPath);
11
+ await TestAdapter.testBuildPass(inputPath, outputPath, {md2md, md2html});
12
+ await compareDirectories(outputPath);
16
13
  });
17
14
  };
18
15
 
@@ -1,16 +1,13 @@
1
1
  import {describe, it} from 'vitest';
2
- import {compareDirectories, getTestPaths} from '../fixtures';
3
- import {CliTestAdapter} from '../fixtures/cliAdapter';
2
+ import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
4
3
 
5
4
  describe('plugin corner cases:', () => {
6
- const cliTestAdapter = new CliTestAdapter();
7
-
8
5
  it('images in deflists — integrity check', async () => {
9
6
  const {inputPath, outputPath} = getTestPaths(
10
7
  'mocks/plugin-corner-cases/images-in-deflists',
11
8
  );
12
9
 
13
- await cliTestAdapter.testPass(inputPath, outputPath, {md2md: true, md2html: false});
14
- compareDirectories(outputPath);
10
+ await TestAdapter.testBuildPass(inputPath, outputPath, {md2md: true, md2html: false});
11
+ await compareDirectories(outputPath);
15
12
  });
16
13
  });
@@ -1,27 +1,24 @@
1
1
  import {describe, it} from 'vitest';
2
2
  import {dedent} from 'ts-dedent';
3
- import {compareDirectories, getTestPaths} from '../fixtures';
4
- import {CliTestAdapter} from '../fixtures/cliAdapter';
3
+ import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
5
4
 
6
5
  function test(_description: string) {
7
- const cliTestAdapter = new CliTestAdapter();
8
-
9
6
  it('internal', async () => {
10
7
  const {inputPath, outputPath} = getTestPaths('mocks/regression');
11
8
 
12
- await cliTestAdapter.testPass(inputPath, outputPath, {md2md: true, md2html: false});
13
- await cliTestAdapter.testPass(outputPath, outputPath + '-html', {
9
+ await TestAdapter.testBuildPass(inputPath, outputPath, {md2md: true, md2html: false});
10
+ await TestAdapter.testBuildPass(outputPath, outputPath + '-html', {
14
11
  md2md: false,
15
12
  md2html: true,
16
13
  });
17
- await cliTestAdapter.testPass(outputPath, outputPath + '-static-html', {
14
+ await TestAdapter.testBuildPass(outputPath, outputPath + '-static-html', {
18
15
  md2md: false,
19
16
  md2html: true,
20
17
  args: '--static-content',
21
18
  });
22
- compareDirectories(outputPath);
23
- compareDirectories(outputPath + '-html');
24
- // compareDirectories(outputPath + '-static-html');
19
+ await compareDirectories(outputPath);
20
+ await compareDirectories(outputPath + '-html');
21
+ // await compareDirectories(outputPath + '-static-html');
25
22
  });
26
23
  }
27
24
 
package/e2e/rtl.spec.ts CHANGED
@@ -1,18 +1,15 @@
1
1
  import {describe, test} from 'vitest';
2
- import {compareDirectories, getTestPaths} from '../fixtures';
3
- import {CliTestAdapter} from '../fixtures/cliAdapter';
2
+ import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
4
3
 
5
4
  const generateMapTestTemplate = (
6
5
  testTitle: string,
7
6
  testRootPath: string,
8
7
  {md2md = true, md2html = true, args = '--allow-custom-resources'},
9
8
  ) => {
10
- const cliTestAdapter = new CliTestAdapter();
11
-
12
9
  test(testTitle, async () => {
13
10
  const {inputPath, outputPath} = getTestPaths(testRootPath);
14
- await cliTestAdapter.testPass(inputPath, outputPath, {md2md, md2html, args});
15
- compareDirectories(outputPath);
11
+ await TestAdapter.testBuildPass(inputPath, outputPath, {md2md, md2html, args});
12
+ await compareDirectories(outputPath);
16
13
  });
17
14
  };
18
15