@diplodoc/cli-tests 5.22.0 → 5.22.3

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.
@@ -4,14 +4,13 @@ exports[`Check bundles > bundles list is correct > filelist 1`] = `
4
4
  "[
5
5
  ".yfm",
6
6
  "_bundle/app-css-1",
7
- "_bundle/app-js-2",
7
+ "_bundle/app-js-0",
8
8
  "_bundle/latex-extension.css",
9
9
  "_bundle/latex-extension.js",
10
10
  "_bundle/mermaid-extension.js",
11
11
  "_bundle/page-constructor-extension.css",
12
12
  "_bundle/page-constructor-extension.js",
13
13
  "_bundle/search-async-0",
14
- "_bundle/search-async-1",
15
14
  "_bundle/search-css-0",
16
15
  "_bundle/search-css-1",
17
16
  "_bundle/search-css-2",
@@ -83,9 +82,9 @@ exports[`Check bundles > bundles list is correct 2`] = `
83
82
  </script>
84
83
  <script type="application/javascript" defer src="toc.js"></script>
85
84
  <script type="application/javascript" defer src="_search/ru/hash-resources.js"></script>
86
- <script type="application/javascript" defer src="_bundle/search-js-1"></script>
85
+ <script type="application/javascript" defer src="_bundle/app-js-0"></script>
86
+ <script type="application/javascript" defer src="_bundle/search-js-0"></script>
87
87
  <script type="application/javascript" defer src="_bundle/search-js-2"></script>
88
- <script type="application/javascript" defer src="_bundle/app-js-2"></script>
89
88
 
90
89
  </body>
91
90
  </html>"
@@ -123,9 +122,9 @@ exports[`Check bundles > bundles list is correct 3`] = `
123
122
  </script>
124
123
  <script type="application/javascript" defer src="toc.js"></script>
125
124
  <script type="application/javascript" defer src="_search/ru/hash-resources.js"></script>
126
- <script type="application/javascript" defer src="_bundle/search-js-1"></script>
125
+ <script type="application/javascript" defer src="_bundle/app-js-0"></script>
126
+ <script type="application/javascript" defer src="_bundle/search-js-0"></script>
127
127
  <script type="application/javascript" defer src="_bundle/search-js-2"></script>
128
- <script type="application/javascript" defer src="_bundle/app-js-2"></script>
129
128
 
130
129
  </body>
131
130
  </html>"
@@ -163,9 +162,9 @@ exports[`Check bundles > bundles list is correct 4`] = `
163
162
  </script>
164
163
  <script type="application/javascript" defer src="toc.js"></script>
165
164
  <script type="application/javascript" defer src="_search/ru/hash-resources.js"></script>
166
- <script type="application/javascript" defer src="_bundle/search-js-1"></script>
165
+ <script type="application/javascript" defer src="_bundle/app-js-0"></script>
166
+ <script type="application/javascript" defer src="_bundle/search-js-0"></script>
167
167
  <script type="application/javascript" defer src="_bundle/search-js-2"></script>
168
- <script type="application/javascript" defer src="_bundle/app-js-2"></script>
169
168
 
170
169
  </body>
171
170
  </html>"
@@ -0,0 +1,32 @@
1
+ import {describe, expect, test} from 'vitest';
2
+ import {existsSync, readFileSync} from 'node:fs';
3
+ import {resolve} from 'node:path';
4
+
5
+ import {TestAdapter, getTestPaths} from '../fixtures';
6
+
7
+ describe('Empty presets.yaml handling', () => {
8
+ test('should not create empty presets.yaml files in md output format when no variables are used', async () => {
9
+ const {inputPath, outputPath} = getTestPaths('mocks/empty-presets');
10
+
11
+ // Test with --output-format=md and disabled templating
12
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
13
+ md2md: true,
14
+ args: '-f md --no-template',
15
+ });
16
+
17
+ // Check that presets.yaml file was NOT created in the output
18
+ const presetsPath = resolve(outputPath, 'presets.yaml');
19
+ expect(existsSync(presetsPath)).toBe(false);
20
+
21
+ // Check that subfolder presets.yaml file was NOT created in the output
22
+ const subfolderPresetsPath = resolve(outputPath, 'subfolder/presets.yaml');
23
+ expect(existsSync(subfolderPresetsPath)).toBe(false);
24
+
25
+ // Verify that the markdown files were still processed correctly
26
+ const indexContent = readFileSync(resolve(outputPath, 'index.md'), 'utf8');
27
+ expect(indexContent).toContain('Test Page');
28
+
29
+ const subpageContent = readFileSync(resolve(outputPath, 'subfolder/subpage.md'), 'utf8');
30
+ expect(subpageContent).toContain('Sub Page');
31
+ });
32
+ });
@@ -0,0 +1 @@
1
+ varsPreset: default
@@ -0,0 +1,3 @@
1
+ # Test Page
2
+
3
+ This is a test page that doesn't use any template variables.
@@ -0,0 +1,3 @@
1
+ other:
2
+ testVariable: "testValue"
3
+ anotherVariable: "anotherValue"
@@ -0,0 +1,3 @@
1
+ other:
2
+ subfolderVariable: "subfolderValue"
3
+ anotherSubVariable: "anotherSubValue"
@@ -0,0 +1,3 @@
1
+ # Sub Page
2
+
3
+ This is a sub page that also doesn't use any template variables.
@@ -0,0 +1,4 @@
1
+ title: Subfolder Documentation
2
+ items:
3
+ - name: Sub Page
4
+ href: subpage.md
@@ -0,0 +1,4 @@
1
+ title: Test Documentation
2
+ items:
3
+ - name: Main Page
4
+ href: index.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.22.0",
3
+ "version": "5.22.3",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },