@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.
@@ -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
  ![with trailing comment](_assets/3.png)<!-- comment -->
226
228
 
227
229
  <!-- ![commented](_assets/4.png) -->
230
+
231
+ ![with backslash](_assets/5/_1.png)
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":"&lt;p&gt;&lt;img src=\\"_assets/1.png\\" alt=\\"simple image\\" /&gt;&lt;/p&gt;/n![with leading comment](_assets/2.png)/n&lt;p&gt;&lt;img src=\\"_assets/3.png\\" alt=\\"with trailing comment\\" /&gt;&lt;/p&gt;/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":"&lt;p&gt;&lt;img src=\\"_assets/1.png\\" alt=\\"simple image\\" /&gt;&lt;/p&gt;/n![with leading comment](_assets/2.png)/n&lt;p&gt;&lt;img src=\\"_assets/3.png\\" alt=\\"with trailing comment\\" /&gt;&lt;/p&gt;/n/n&lt;p&gt;&lt;img src=\\"_assets/5_1.png\\" alt=\\"with backslash\\" /&gt;&lt;/p&gt;/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');
@@ -30,8 +30,6 @@ class Build {
30
30
  '--quiet',
31
31
  '--allowHTML',
32
32
  ...args,
33
- '-e',
34
- 'report-logs',
35
33
  ]);
36
34
  }
37
35
  }
@@ -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').filter((line) => line.match(filter));
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
@@ -7,3 +7,5 @@
7
7
  ![with trailing comment](_assets/3.png)<!-- comment -->
8
8
 
9
9
  <!-- ![commented](_assets/4.png) -->
10
+
11
+ ![with backslash](_assets/5\_1.png)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.0.4",
3
+ "version": "5.0.6",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },
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', 'dist'],
22
+ exclude: ['node_modules'],
24
23
  coverage: {
25
24
  enabled: false,
26
25
  },