@diplodoc/cli-tests 5.31.2 → 5.32.0

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.
@@ -55,4 +55,20 @@ describe('Crawler manifest', () => {
55
55
 
56
56
  expect(manifest['index.md']).toContain('https://config.example.com');
57
57
  });
58
+
59
+ test('excludes urls by exact match and regexp from docs-viewer.crawler.exclude', async () => {
60
+ const {inputPath, outputPath} = getTestPaths('mocks/crawler-manifest/exclude');
61
+
62
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
63
+ md2md: true,
64
+ md2html: false,
65
+ });
66
+
67
+ const manifestContent = await readFile(join(outputPath, 'crawler-manifest.json'), 'utf-8');
68
+ const manifest = JSON.parse(manifestContent);
69
+
70
+ expect(manifest['index.md']).toContain('https://kept.example.com');
71
+ expect(manifest['index.md']).not.toContain('https://excluded-exact.example.com');
72
+ expect(manifest['index.md']).not.toContain('https://excluded-regexp.example.com/some/path');
73
+ });
58
74
  });
@@ -0,0 +1,9 @@
1
+ crawlerManifest: true
2
+
3
+ docs-viewer:
4
+ crawler:
5
+ exclude:
6
+ url:
7
+ - https://excluded-exact.example.com
8
+ regexp:
9
+ - /excluded-regexp\.example\.com/
@@ -0,0 +1,5 @@
1
+ # Index
2
+
3
+ [Kept link](https://kept.example.com)
4
+ [Excluded by url](https://excluded-exact.example.com)
5
+ [Excluded by regexp](https://excluded-regexp.example.com/some/path)
@@ -0,0 +1,4 @@
1
+ title: Crawler manifest exclude test
2
+ items:
3
+ - name: Index
4
+ href: index.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.31.2",
3
+ "version": "5.32.0",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },