Path: blob/main/tests/smoke/website/website-sidebar-auto.test.ts
12925 views
/*1* website-sidebar-auto.test.ts2*3* Verifies that sidebar auto-generation properly detects index files with4* non-qmd extensions (like .ipynb) in subdirectories. This tests the5* engineValidExtensions() call in indexFileHrefForDir() which must work6* before resolveEngines() has been called.7*8* Copyright (C) 2020-2025 Posit Software, PBC9*/1011import { docs } from "../../utils.ts";12import { join } from "../../../src/deno_ral/path.ts";13import { existsSync } from "../../../src/deno_ral/fs.ts";14import { testQuartoCmd } from "../../test.ts";15import { fileExists, noErrorsOrWarnings } from "../../verify.ts";1617const renderDir = docs("websites/website-sidebar-auto");18const outDir = join(Deno.cwd(), renderDir, "_site");1920// Test that sidebar auto-generation detects index.ipynb in subdirectory21testQuartoCmd(22"render",23[renderDir],24[25noErrorsOrWarnings,26fileExists(join(outDir, "index.html")), // Main index page27fileExists(join(outDir, "subdir", "index.html")), // Subdir index from .ipynb should be rendered28],29{30teardown: async () => {31if (existsSync(outDir)) {32await Deno.remove(outDir, { recursive: true });33}34},35},36);373839