diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js index 499034cd8a3684..c74d19dfe9f7c6 100644 --- a/test/doctool/test-doctool-html.js +++ b/test/doctool/test-doctool-html.js @@ -95,6 +95,10 @@ const testData = [ html: '
  1. fish
  2. fish
' + '', }, + { + file: fixtures.path('altdocs.md'), + html: '
  • 8.x', + }, ]; const spaces = /\s/g; @@ -117,7 +121,8 @@ testData.forEach(({ file, html }) => { const actual = output.replace(spaces, ''); // Assert that the input stripped of all whitespace contains the // expected markup. - assert(actual.includes(expected)); + assert(actual.includes(expected), + `ACTUAL: ${actual}\nEXPECTED: ${expected}`); }) ); })); diff --git a/test/fixtures/altdocs.md b/test/fixtures/altdocs.md new file mode 100644 index 00000000000000..f26c89c89af4ab --- /dev/null +++ b/test/fixtures/altdocs.md @@ -0,0 +1,3 @@ +# ALTDOCS + + diff --git a/tools/doc/html.js b/tools/doc/html.js index 9c9c355574d4e5..ce53bceaa24a15 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -427,6 +427,7 @@ function altDocs(filename, docCreated) { const [versionMajor, versionMinor] = version.num.split('.').map(Number); if (docCreatedMajor > versionMajor) return false; if (docCreatedMajor < versionMajor) return true; + if (Number.isNaN(versionMinor)) return true; return docCreatedMinor <= versionMinor; }