@diplodoc/cli-tests 0.0.0-rc-anchor-lint-check-202506201214 → 0.0.0-rc-toc-translation-202506261401
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.
- package/e2e/__snapshots__/translation.spec.ts.snap +1267 -392
- package/e2e/translation.spec.ts +15 -3
- package/mocks/translation/dir-files/input/.yfm +6 -0
- package/mocks/translation/dir-files/input/ru/aboba.md +2 -4
- package/mocks/translation/dir-files/input/ru/nested/a1.md +3 -0
- package/mocks/translation/dir-files/input/ru/nested/folder1/a1.md +3 -0
- package/mocks/translation/dir-files/input/ru/nested/folder1/toc-i.yaml +3 -0
- package/mocks/translation/dir-files/input/ru/nested/toc.yaml +1 -0
- package/mocks/translation/dir-files/input/ru/no-var-page.md +3 -0
- package/mocks/translation/dir-files/input/ru/to-be-excluded.md +1 -0
- package/mocks/translation/dir-files/input/ru/toc.yaml +7 -1
- package/package.json +1 -1
package/e2e/translation.spec.ts
CHANGED
|
@@ -6,12 +6,12 @@ const generateMapTestTemplate = (
|
|
|
6
6
|
testRootPath: string,
|
|
7
7
|
args: TranslateRunArgs,
|
|
8
8
|
) => {
|
|
9
|
-
test
|
|
9
|
+
test(testTitle, async () => {
|
|
10
10
|
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
11
11
|
|
|
12
12
|
await TestAdapter.testTranslatePass(inputPath, outputPath, args);
|
|
13
13
|
|
|
14
|
-
await compareDirectories(outputPath
|
|
14
|
+
await compareDirectories(outputPath);
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -43,7 +43,19 @@ describe('Translate command', () => {
|
|
|
43
43
|
subcommand: 'extract',
|
|
44
44
|
source: 'ru-RU',
|
|
45
45
|
target: 'es-ES',
|
|
46
|
-
additionalArgs: '--exclude ru/
|
|
46
|
+
additionalArgs: '--exclude ru/to-be-excluded.md',
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const vars = {skip: 'prod'}
|
|
51
|
+
generateMapTestTemplate(
|
|
52
|
+
'filter files on extract with extra vars option',
|
|
53
|
+
'mocks/translation/dir-files',
|
|
54
|
+
{
|
|
55
|
+
subcommand: 'extract',
|
|
56
|
+
source: 'ru-RU',
|
|
57
|
+
target: 'es-ES',
|
|
58
|
+
additionalArgs: `--vars ${JSON.stringify(vars)}`,
|
|
47
59
|
},
|
|
48
60
|
);
|
|
49
61
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
## Excluded title
|
|
@@ -4,4 +4,10 @@ items:
|
|
|
4
4
|
- name: Aboba
|
|
5
5
|
href: aboba.md
|
|
6
6
|
- name: Не переводить
|
|
7
|
-
|
|
7
|
+
when: skip == 'prod'
|
|
8
|
+
href: _no-translate/exclude.md
|
|
9
|
+
- name: Нет переменной в vars
|
|
10
|
+
when: novar == 'test'
|
|
11
|
+
href: no-var-page.md
|
|
12
|
+
- name: exclude-test
|
|
13
|
+
href: to-be-excluded.md
|