diff --git a/lib/sidebars.test.mts b/lib/sidebars.test.mts new file mode 100644 index 00000000..1ea2cfd4 --- /dev/null +++ b/lib/sidebars.test.mts @@ -0,0 +1,18 @@ +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; +import sidebars from '../sidebars.ts'; + +// sidebars.ts is imported by docusaurus.config.ts and so is exercised by the +// e2e link-rewrite build (e2e/linkRewrite.test.mjs), but it has no unit +// coverage: c8's default (non --all) report simply omits any file that no +// unit test ever imports, so this module is invisible to the 100% +// unit-coverage gate rather than counting against it. Import it directly so +// a regression to the autogenerated docSidebar shape fails fast in the unit +// suite, without waiting on a full Docusaurus build. +describe('sidebars', () => { + it('exports a docSidebar generated from the docs folder structure', () => { + assert.deepEqual(sidebars, { + docSidebar: [{ type: 'autogenerated', dirName: '.' }], + }); + }); +}); diff --git a/lib/sidebarsAnalyses.test.mts b/lib/sidebarsAnalyses.test.mts new file mode 100644 index 00000000..7b09b0e4 --- /dev/null +++ b/lib/sidebarsAnalyses.test.mts @@ -0,0 +1,19 @@ +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; +import sidebars from '../sidebarsAnalyses.ts'; + +// sidebarsAnalyses.ts is imported by docusaurus.config.ts's analyses plugin +// and so is exercised by the e2e link-rewrite build +// (e2e/linkRewrite.test.mjs), but it has no unit coverage: c8's default +// (non --all) report simply omits any file that no unit test ever imports, +// so this module is invisible to the 100% unit-coverage gate rather than +// counting against it. Import it directly so a regression to the +// autogenerated analysesSidebar shape fails fast in the unit suite, without +// waiting on a full Docusaurus build. +describe('sidebarsAnalyses', () => { + it('exports an analysesSidebar generated from the analyses folder structure', () => { + assert.deepEqual(sidebars, { + analysesSidebar: [{ type: 'autogenerated', dirName: '.' }], + }); + }); +});