Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/sidebars.test.mts
Original file line number Diff line number Diff line change
@@ -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: '.' }],
});
});
});
19 changes: 19 additions & 0 deletions lib/sidebarsAnalyses.test.mts
Original file line number Diff line number Diff line change
@@ -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: '.' }],
});
});
});