mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
10 hours ago c70b22c0c65d21fc25eda46a8182eb042da11da0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { test } from "node:test";
import { fileURLToPath } from "node:url";
import { load } from "cheerio";
import { buildFixtureSite } from "../../support/prepare-site.mjs";
 
const source = dirname(fileURLToPath(import.meta.url));
test("copy_code=false disables the site-wide code wrapper and button (#986)", () => {
  const output = buildFixtureSite({ source });
  const $ = load(readFileSync(join(output, "example/index.html"), "utf8"));
  assert.equal($(".code-copy, .code-block").length, 0);
  assert.match($("pre code").text(), /copy_code = false/);
});