@diplodoc/cli-tests 5.0.4 → 5.0.6
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__/regression.test.ts.snap +5 -1
- package/fixtures/cliAdapter.ts +0 -2
- package/fixtures/runners/binary.ts +5 -2
- package/fixtures/runners/index.ts +3 -1
- package/mocks/regression/input/_assets/5_1.png +0 -0
- package/mocks/regression/input/images.md +2 -0
- package/package.json +1 -1
- package/vitest.config.ts +1 -2
|
@@ -6,6 +6,7 @@ exports[`Regression > internal > filelist 1`] = `
|
|
|
6
6
|
"_assets/1.png",
|
|
7
7
|
"_assets/2.png",
|
|
8
8
|
"_assets/3.png",
|
|
9
|
+
"_assets/5_1.png",
|
|
9
10
|
"_assets/empty.pdf",
|
|
10
11
|
"autotitle.md",
|
|
11
12
|
"generic/1.md",
|
|
@@ -40,6 +41,7 @@ exports[`Regression > internal > filelist 2`] = `
|
|
|
40
41
|
"_assets/1.png",
|
|
41
42
|
"_assets/2.png",
|
|
42
43
|
"_assets/3.png",
|
|
44
|
+
"_assets/5_1.png",
|
|
43
45
|
"_assets/empty.pdf",
|
|
44
46
|
"_bundle/search-async-1",
|
|
45
47
|
"_bundle/search-async-0",
|
|
@@ -225,6 +227,8 @@ metadata:
|
|
|
225
227
|
<!-- comment -->
|
|
226
228
|
|
|
227
229
|
<!--  -->
|
|
230
|
+
|
|
231
|
+

|
|
228
232
|
"
|
|
229
233
|
`;
|
|
230
234
|
|
|
@@ -937,7 +941,7 @@ exports[`Regression > internal 34`] = `
|
|
|
937
941
|
<body class="g-root g-root_theme_light">
|
|
938
942
|
<div id="root"></div>
|
|
939
943
|
<script type="application/json" id="diplodoc-state">
|
|
940
|
-
{"data":{"leading":false,"html":"<p><img src=\\"_assets/1.png\\" alt=\\"simple image\\" /></p>/n/n<p><img src=\\"_assets/3.png\\" alt=\\"with trailing comment\\" /></p>/n/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"headings":[],"title":"Images"},"router":{"pathname":"images","depth":1,"base":"./"},"lang":"ru","langs":["ru"]}
|
|
944
|
+
{"data":{"leading":false,"html":"<p><img src=\\"_assets/1.png\\" alt=\\"simple image\\" /></p>/n/n<p><img src=\\"_assets/3.png\\" alt=\\"with trailing comment\\" /></p>/n/n<p><img src=\\"_assets/5_1.png\\" alt=\\"with backslash\\" /></p>/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}]},"headings":[],"title":"Images"},"router":{"pathname":"images","depth":1,"base":"./"},"lang":"ru","langs":["ru"]}
|
|
941
945
|
</script>
|
|
942
946
|
<script type="application/javascript">
|
|
943
947
|
const data = document.querySelector('script#diplodoc-state');
|
package/fixtures/cliAdapter.ts
CHANGED
|
@@ -9,7 +9,7 @@ export class BinaryRunner implements Runner {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
async runYfmDocs(argv: string[]) {
|
|
12
|
-
const {stderr, exitCode} = await execa(this.binaryPath, argv, {all: true});
|
|
12
|
+
const {stderr, exitCode} = await execa(this.binaryPath, argv, {all: true, reject: false});
|
|
13
13
|
const report = {
|
|
14
14
|
code: exitCode || 0,
|
|
15
15
|
warns: fillLog(/^WARN/, stderr),
|
|
@@ -28,5 +28,8 @@ export class BinaryRunner implements Runner {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function fillLog(filter: RegExp, source: string) {
|
|
31
|
-
return source.split('\n')
|
|
31
|
+
return source.split('\n')
|
|
32
|
+
.filter((line) => line.match(filter))
|
|
33
|
+
.map((line) => line.trim())
|
|
34
|
+
.filter(Boolean);
|
|
32
35
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {resolve} from 'node:path';
|
|
2
|
+
|
|
1
3
|
import {SourceRunner} from './source';
|
|
2
4
|
import {BinaryRunner} from './binary';
|
|
3
5
|
import {Runner} from './types';
|
|
@@ -5,7 +7,7 @@ import {Runner} from './types';
|
|
|
5
7
|
export {Runner};
|
|
6
8
|
|
|
7
9
|
export function createRunner(): Runner {
|
|
8
|
-
const binaryPath = process.env.DIPLODOC_BINARY_PATH;
|
|
10
|
+
const binaryPath = process.env.DIPLODOC_BINARY_PATH || resolve(__dirname, '../../../build/index.js');
|
|
9
11
|
|
|
10
12
|
if (binaryPath) {
|
|
11
13
|
return new BinaryRunner(binaryPath);
|
|
File without changes
|
package/package.json
CHANGED
package/vitest.config.ts
CHANGED
|
@@ -17,10 +17,9 @@ export default defineConfig({
|
|
|
17
17
|
environment: 'node',
|
|
18
18
|
include: [
|
|
19
19
|
'e2e/**/*.{test,spec}.ts',
|
|
20
|
-
'units/**/*.{test,spec}.ts',
|
|
21
20
|
...resolvedTestPaths.map((path) => `${path}/**/*.{test,spec}.ts`),
|
|
22
21
|
],
|
|
23
|
-
exclude: ['node_modules'
|
|
22
|
+
exclude: ['node_modules'],
|
|
24
23
|
coverage: {
|
|
25
24
|
enabled: false,
|
|
26
25
|
},
|