@diplodoc/cli-tests 0.0.0-rc-extract-openapi-test-19463999580 → 0.0.0-rc-extract-openapi-test-19466615979
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/translation.spec.ts
CHANGED
|
@@ -9,13 +9,15 @@ const generateMapTestTemplate = (
|
|
|
9
9
|
testRootPath: string,
|
|
10
10
|
args: TranslateRunArgs,
|
|
11
11
|
ignoreFileContent = true,
|
|
12
|
+
// TODO: added especialy for 'extract openapi spec files with custom openapi schema provided' test, arc test issue
|
|
13
|
+
ignoreFileList = false,
|
|
12
14
|
) => {
|
|
13
15
|
test(testTitle, async () => {
|
|
14
16
|
const {inputPath, outputPath} = getTestPaths(testRootPath);
|
|
15
17
|
|
|
16
18
|
await TestAdapter.testTranslatePass(inputPath, outputPath, args);
|
|
17
19
|
|
|
18
|
-
await compareDirectories(outputPath, ignoreFileContent);
|
|
20
|
+
await compareDirectories(outputPath, ignoreFileContent, false, ignoreFileList);
|
|
19
21
|
});
|
|
20
22
|
};
|
|
21
23
|
|
|
@@ -67,7 +69,7 @@ describe('Translate command', () => {
|
|
|
67
69
|
target: 'es-ES',
|
|
68
70
|
});
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
generateMapTestTemplate(
|
|
71
73
|
'extract openapi spec files with custom openapi schema provided',
|
|
72
74
|
'mocks/translation/openapi',
|
|
73
75
|
{
|
|
@@ -77,6 +79,8 @@ describe('Translate command', () => {
|
|
|
77
79
|
additionalArgs:
|
|
78
80
|
'--schema mocks/translation/custom-schema/custom-openapi-schema-30.yaml',
|
|
79
81
|
},
|
|
82
|
+
false,
|
|
83
|
+
true,
|
|
80
84
|
);
|
|
81
85
|
|
|
82
86
|
generateFilesYamlTestTemplate('compose openapi spec files', 'mocks/translation/compose', {
|
package/fixtures/utils/file.ts
CHANGED
|
@@ -57,6 +57,7 @@ export async function compareDirectories(
|
|
|
57
57
|
outputPath: string,
|
|
58
58
|
ignoreFileContent = false,
|
|
59
59
|
checkBundle = false,
|
|
60
|
+
ignoreFileList = false,
|
|
60
61
|
) {
|
|
61
62
|
const filesFromOutput = (
|
|
62
63
|
await glob(`**/*`, {
|
|
@@ -84,7 +85,9 @@ export async function compareDirectories(
|
|
|
84
85
|
// We sort only the final list and put it in the snapshot
|
|
85
86
|
filesForSnapshot = filesForSnapshot.map(hashless).sort();
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
if (!ignoreFileList) {
|
|
89
|
+
expect(JSON.stringify(filesForSnapshot, null, 2)).toMatchSnapshot('filelist');
|
|
90
|
+
}
|
|
88
91
|
|
|
89
92
|
if (!ignoreFileContent) {
|
|
90
93
|
filesFromOutput
|