@diplodoc/cli-tests 5.25.4 → 5.26.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.
- package/e2e/errors.spec.ts +20 -1
- package/mocks/errors/unreachable-link-in-include/input/_includes/chapter.md +1 -0
- package/mocks/errors/unreachable-link-in-include/input/index.md +5 -0
- package/mocks/errors/unreachable-link-in-include/input/toc.yaml +1 -0
- package/mocks/errors/unreachable-link-in-nested-include/input/_includes/chapter.md +3 -0
- package/mocks/errors/unreachable-link-in-nested-include/input/_includes/details.md +1 -0
- package/mocks/errors/unreachable-link-in-nested-include/input/index.md +3 -0
- package/mocks/errors/unreachable-link-in-nested-include/input/toc.yaml +1 -0
- package/mocks/errors/valid-link-in-include/input/_includes/content.md +1 -0
- package/mocks/errors/valid-link-in-include/input/index.md +3 -0
- package/mocks/errors/valid-link-in-include/input/page.md +3 -0
- package/mocks/errors/valid-link-in-include/input/toc.yaml +4 -0
- package/package.json +1 -1
package/e2e/errors.spec.ts
CHANGED
|
@@ -92,10 +92,29 @@ describe('Errors', () => {
|
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
+
describe('Include chain errors', () => {
|
|
96
|
+
test('mocks/errors/unreachable-link-in-include', ({html}: TestResult) => {
|
|
97
|
+
expectErrors(html, [
|
|
98
|
+
'ERR index.md: 5: YFM003 / unreachable-link Link is unreachable [Context: "index.md:5 → _includes/chapter.md:1 ↛ _includes/nonexistent.html; Reason: File is not declared in toc"]',
|
|
99
|
+
]);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test('mocks/errors/unreachable-link-in-nested-include', ({html}: TestResult) => {
|
|
103
|
+
expectErrors(html, [
|
|
104
|
+
'ERR index.md: 3: YFM003 / unreachable-link Link is unreachable [Context: "index.md:3 → _includes/chapter.md:3 → _includes/details.md:1 ↛ _includes/nonexistent.html; Reason: File is not declared in toc"]',
|
|
105
|
+
]);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test('mocks/errors/valid-link-in-include', ({html}: TestResult) => {
|
|
109
|
+
const yfm003 = html.errors.filter((e: string) => e.includes('YFM003'));
|
|
110
|
+
expect(yfm003).toEqual([]);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
95
114
|
describe('Warnings', () => {
|
|
96
115
|
test('mocks/warning/unreachable-autotitle', ({html}: TestResult) => {
|
|
97
116
|
expectWarnings(html, [
|
|
98
|
-
'WARN index.md: 1: YFM010 / unreachable-autotitle-anchor Auto title anchor is unreachable [Context: "
|
|
117
|
+
'WARN index.md: 1: YFM010 / unreachable-autotitle-anchor Auto title anchor is unreachable [Context: "Unreachable autotitle anchor: "link.html#unknown_yfm010"; Line: 1"]',
|
|
99
118
|
]);
|
|
100
119
|
});
|
|
101
120
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[broken link](nonexistent.md)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
href: index.md
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[broken link](nonexistent.md)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
href: index.md
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Check out [the page](../page.md) for details.
|