|
| 1 | +/* |
| 2 | +* github-issue-1340.test.ts |
| 3 | +* |
| 4 | +* Copyright (C) 2022 by RStudio, PBC |
| 5 | +* |
| 6 | +*/ |
| 7 | + |
| 8 | +import { docs, fileLoader, outputForInput } from "../../utils.ts"; |
| 9 | +import { |
| 10 | + ensureHtmlElements, |
| 11 | + ensureHtmlSelectorSatisfies, |
| 12 | + verifyPath, |
| 13 | +} from "../../verify.ts"; |
| 14 | +import { testRender } from "../../smoke/render/render.ts"; |
| 15 | +import { ExecuteOutput } from "../../test.ts"; |
| 16 | +import { join } from "path/mod.ts"; |
| 17 | + |
| 18 | +const input = docs("bug-repros/issue-1340/"); |
| 19 | +const output = join(input, "_book"); |
| 20 | +// const output = outputForInput(join(input, "index.qmd"), "html"); <- doesn't work for book projects, right. |
| 21 | +testRender(input, "html", false, [{ |
| 22 | + name: "file exists", |
| 23 | + verify: (_outputs: ExecuteOutput[]): Promise<void> => { |
| 24 | + verifyPath( |
| 25 | + join( |
| 26 | + output, |
| 27 | + "index_files", |
| 28 | + "figure-html", |
| 29 | + "unnamed-chunk-4-1.png", |
| 30 | + ), |
| 31 | + ); |
| 32 | + return Promise.resolve(); |
| 33 | + }, |
| 34 | +}, { |
| 35 | + name: "manual cleanup for book project", |
| 36 | + verify: (_outputs: ExecuteOutput[]): Promise<void> => { |
| 37 | + Deno.removeSync(output, { recursive: true }); |
| 38 | + Deno.removeSync(join(input, ".quarto"), { recursive: true }); |
| 39 | + Deno.removeSync(join(input, ".gitignore")); |
| 40 | + |
| 41 | + return Promise.resolve(); |
| 42 | + }, |
| 43 | +}]); |
0 commit comments