@diplodoc/cli-tests 5.22.0 → 5.22.1

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.
@@ -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.1",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },