// The look of a highlights cut (look.mjs, release 36 lane C): the validators, // the caption lines and their ASS document, the vertical crop -- and real // renders: a cut without the new keys is byte for byte what it was; loudness // lands within ±0.5 LU of its target; a caption appears on its frame, in its // speaker's colour and side; a short is 1080x1920 and shows the crop. // // Run with: pnpm test:scripts import assert from "node:assert/strict"; import { spawnSync } from "node:child_process"; import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs"; import { readFile, rm, writeFile } from "node:fs/promises"; import os from "node:os"; import path from "node:path"; import test from "node:test"; // The corpus the build reads metadata and cues from: set before build-video // (cues.mjs) is loaded, so it is this file's own. const CORPUS = mkdtempSync(path.join(os.tmpdir(), "rtv-look-corpus-")); process.env.CHANNELS_DIR = CORPUS; const { CAPTION_COLOURS, SHORT_HEIGHT, SHORT_WIDTH, assColour, assDocument, assTime, captionLines, cropPixels, defaultCrop, loudnessTargetOf, shortRender, speakerAt, speakerCaptionLabel, validateLook, verticalErrors, verticalFilters, } = await import("./look.mjs"); const { buildVideo, measureLoudness, setProgressMode, takesHeavySlot } = await import("./build-video.mjs"); const { lintManifest } = await import("./lint.mjs"); const { MONO_BOLD_FONT_FILE, MONO_FONT_FILE } = await import("./brand.mjs"); test.after(() => rm(CORPUS, { recursive: true, force: true })); // ---- the validators ------------------------------------------------------------- const m = (render = {}, timeline = []) => ({ render, timeline }); test("validateLook: absent or null says nothing; the seed's default look validates", () => { assert.deepEqual(validateLook(m()), []); assert.deepEqual(validateLook(m({ captions: null, loudness: null })), []); // Lane B's seed for a site-less, one-video cut. assert.deepEqual(validateLook(m({ headerHeight: 0, footerHeight: 0, qr: false, transition: 0.5, transitionStyle: "fadeblack", loudness: { target: -16 } })), []); assert.deepEqual(validateLook(m({ captions: { style: "speakers" } })), []); assert.deepEqual(validateLook(m({ captions: { style: "speakers", size: "l", labels: { host: "Nik", subject: null } } })), []); }); test("validateLook: captions -- each problem in a sentence naming the key", () => { const e = (c, extra = {}) => validateLook(m({ captions: c, ...extra })); assert.match(e("on")[0], /render\.captions must be an object/); assert.match(e({ style: "karaoke" })[0], /render\.captions\.style must be "speakers", not "karaoke"/); assert.match(e({ style: "speakers", size: "xl" })[0], /render\.captions\.size must be "m" or "l"/); assert.match(e({ style: "speakers", colour: "red" })[0], /render\.captions\.colour is not a setting here/); assert.match(e({ style: "speakers", labels: { guest: "x" } })[0], /labels\.guest is not a role here/); assert.match(e({ style: "speakers", labels: { host: "x".repeat(41) } })[0], /labels\.host must be a short text/); assert.match(e({ style: "speakers" }, { chrome: { engine: "hyperframes" } })[0], /does not combine with render\.chrome/); assert.match(e({ style: "speakers" }, { montage: {} })[0], /does not combine with render\.montage/); }); test("validateLook: loudness is a target from -30 to -8 LUFS", () => { const e = (l, extra = {}) => validateLook(m({ loudness: l, ...extra })); assert.deepEqual(e({ target: -30 }), []); assert.deepEqual(e({ target: -8 }), []); assert.match(e({ target: -7 })[0], /render\.loudness\.target must be a number from -30 to -8 LUFS, not -7/); assert.match(e({ target: "-16" })[0], /not "-16"/); assert.match(e({ target: -16, lra: 7 })[0], /render\.loudness\.lra is not a setting here/); assert.match(e(-16)[0], /render\.loudness must be an object/); assert.match(e({ target: -16 }, { montage: {} })[0], /render\.montage\.loudness/); assert.equal(loudnessTargetOf({ loudness: { target: -14 } }), -14); assert.equal(loudnessTargetOf({}), null); }); test("validateLook: a clip's vertical crop lies inside the picture and is 9:16 on the source", () => { const clip = (vertical) => ({ type: "clip", id: "c1", video: "v", start: 0, end: 5, vertical }); const e = (v) => validateLook(m({}, [clip(v)])); assert.deepEqual(e(undefined), []); assert.deepEqual(e({ crop: defaultCrop() }), []); assert.deepEqual(e({ crop: [0, 0, 0.3164, 1] }), []); // A 4:3 source's 9:16 box is wider in fractions. assert.deepEqual(e({ crop: defaultCrop(4 / 3), aspect: 4 / 3 }), []); assert.match(e({ crop: [0, 0, 0.5, 1] })[0], /timeline\[0\] \(c1\)\.vertical\.crop must be 9:16 on the source/); assert.match(e({ crop: [0.8, 0, 0.3164, 1] })[0], /must lie inside the picture/); assert.match(e({ crop: [0, 0, 1] })[0], /must be \[x, y, w, h\]/); assert.match(e({ crop: defaultCrop(), zoom: 2 })[0], /vertical\.zoom is not a setting here/); assert.match(e("centre")[0], /vertical must be an object/); assert.match(validateLook(m({}, [{ type: "card", id: "k", vertical: { crop: defaultCrop() } }]))[0], /only a clip has a vertical crop/); assert.deepEqual(verticalErrors(null), []); }); test("the lint says it too", () => { const lint = lintManifest({ slug: "x", title: "X", render: { width: 320, height: 180, fps: 30, captions: { style: "nope" } }, timeline: [] }, { manifestDir: os.tmpdir(), exists: () => true }); assert.ok(lint.errors.some((x) => /render\.captions\.style/.test(x)), lint.errors.join("; ")); }); // ---- the crop ------------------------------------------------------------------- test("defaultCrop / cropPixels: centred, full height, exactly 9:16 and even", () => { assert.deepEqual(defaultCrop(16 / 9), [0.3418, 0, 0.3164, 1]); assert.deepEqual(cropPixels(defaultCrop(16 / 9), 1920, 1080), { x: 656, y: 0, w: 608, h: 1080 }); assert.deepEqual(cropPixels(null, 1920, 1080), { x: 656, y: 0, w: 608, h: 1080 }); // Off to the right, clamped inside. assert.deepEqual(cropPixels([0.7, 0, 0.3164, 1], 1920, 1080), { x: 1312, y: 0, w: 608, h: 1080 }); // A smaller box: its height kept, its centre kept. const b = cropPixels([0.25, 0.25, 0.1582, 0.5], 1920, 1080); assert.deepEqual(b, { x: 480, y: 270, w: 304, h: 540 }); assert.equal(b.w / b.h, 9 / 16 + (304 / 540 - 9 / 16)); assert.deepEqual(verticalFilters(null, 1920, 1080, { fps: 30 }), ["crop=608:1080:656:0", "scale=1080:1920:flags=lanczos", "setsar=1", "fps=30"]); }); test("shortRender: 1080x1920, no header, footer, QR, rail or deck; large captions; the cut's loudness, else -16", () => { const r = shortRender({ width: 1920, height: 1080, fps: 30, headerHeight: 56, qr: { margin: 20 }, chrome: { engine: "hyperframes" }, rail: { width: 300 }, captions: { style: "speakers", labels: { host: "Nik" } } }); assert.equal(r.width, SHORT_WIDTH); assert.equal(r.height, SHORT_HEIGHT); assert.equal(r.headerHeight, 0); assert.equal(r.footerHeight, 0); assert.equal(r.qr, false); assert.equal(r.chrome, undefined); assert.equal(r.rail, undefined); assert.deepEqual(r.captions, { style: "speakers", labels: { host: "Nik" }, size: "l" }); assert.deepEqual(r.loudness, { target: -16 }); assert.deepEqual(shortRender({ loudness: { target: -14 } }).loudness, { target: -14 }); assert.equal(takesHeavySlot({ opts: { short: "c1" }, only: "c1" }), true); assert.equal(takesHeavySlot({ only: "c1" }), false); }); // ---- the caption lines ---------------------------------------------------------- const SPEAKERS = [ { index: 0, role: "host", label: "Host" }, { index: 1, role: "subject", label: "Subject" }, { index: 2, role: "other", label: "Speaker 3" }, ]; const word = (text, start, end = start + 0.3) => ({ text, start, end }); test("captionLines: 2-6 words a line, broken on pauses, never across a change of speaker", () => { const words = [ // subject, 0-4: eight words in a run, then a pause, then two ...["a", "b", "c", "d", "e", "f", "g", "h"].map((w, i) => word(w, 0.1 + i * 0.35)), word("i", 3.4), word("j", 3.75), // host, 4-6: one word, then the subject again word("wow", 4.2), word("k", 6.1), word("l", 6.45), ]; const turns = [{ start: 0, end: 4, speaker: 1 }, { start: 4, end: 6, speaker: 0 }, { start: 6, end: 8, speaker: 1 }]; const lines = captionLines({ words, turns, speakers: SPEAKERS, seconds: 8 }); assert.deepEqual(lines.map((l) => [l.text, l.role]), [ ["a b c d e f", "subject"], ["g h", "subject"], ["i j", "subject"], ["wow", "host"], ["k l", "subject"], ]); // A line starts on its first word; it holds 0.3 s, never past the next. assert.equal(lines[0].start, 0.1); assert.equal(lines[1].end, Math.min(lines[2].start, 0.1 + 7 * 0.35 + 0.3 + 0.3)); assert.equal(lines.at(-1).end, 6.45 + 0.3 + 0.3); // No labels unless somebody gave one. assert.ok(lines.every((l) => l.label === null)); }); test("captionLines: a label heads each turn's first line -- the cut's, else a person's", () => { const words = [word("one", 0.1), word("two", 0.5), word("three", 0.9), word("four", 2.1), word("five", 2.5)]; const turns = [{ start: 0, end: 1.5, speaker: 0 }, { start: 2, end: 3, speaker: 1 }]; const set = captionLines({ words, turns, speakers: SPEAKERS, captions: { style: "speakers", labels: { host: "Nik" } }, seconds: 4 }); assert.deepEqual(set.map((l) => l.label), ["Nik", null]); const named = captionLines({ words, turns, speakers: [{ index: 0, role: "host", label: "Host" }, { index: 1, role: "subject", label: "The narrator" }], seconds: 4 }); assert.deepEqual(named.map((l) => l.label), [null, "The narrator"]); assert.equal(speakerCaptionLabel({ index: 2, role: "other", label: "Speaker 3" }, {}), null); assert.equal(speakerCaptionLabel({ index: 2, role: "other", label: "Chat" }, {}), "Chat"); }); test("speakerAt: the turn a word's middle is in, else the nearest within 0.6 s, else none", () => { const turns = [{ start: 0, end: 1, speaker: 0 }, { start: 3, end: 4, speaker: 1 }]; assert.equal(speakerAt(turns, 0.2, 0.5), 0); assert.equal(speakerAt(turns, 1.2, 1.4), 0); assert.equal(speakerAt(turns, 2.6, 2.7), 1); assert.equal(speakerAt(turns, 1.8, 2.0), null); assert.equal(speakerAt([], 0, 1), null); }); test("assDocument: a style per role in its colour and side; times in centiseconds; a label smaller", () => { assert.equal(assTime(0), "0:00:00.00"); assert.equal(assTime(61.234), "0:01:01.23"); assert.equal(assTime(3725.996), "1:02:06.00"); assert.equal(assColour("#FFC840"), "&H0040C8FF"); assert.equal(assColour("#000000", 0x80), "&H80000000"); const doc = assDocument( [{ start: 1.5, end: 2.25, text: "hello {there}", role: "host", label: "Nik" }, { start: 2.5, end: 3, text: "hi", role: "subject", label: null }], { width: 1920, height: 1080, size: "m" }, ); assert.match(doc, /PlayResX: 1920\nPlayResY: 1080/); assert.match(doc, new RegExp(`Style: host,IBM Plex Sans,56,${assColour(CAPTION_COLOURS.host).replace("&", "&")},.*,1,\\d+,\\d+,1,96,96,76,1`)); assert.match(doc, /Style: subject,IBM Plex Sans,56,&H00FFD36F,.*,3,96,96,76,1/); assert.match(doc, /Style: other,IBM Plex Sans,56,&H00E6F1F6,.*,2,96,96,76,1/); assert.match(doc, /Dialogue: 0,0:00:01\.50,0:00:02\.25,host,,0,0,0,,\{\\fs35\}Nik\{\\fs56\} {2}hello there/); assert.match(doc, /Dialogue: 0,0:00:02\.50,0:00:03\.00,subject,,0,0,0,,hi\n/); const big = assDocument([], { width: 1080, height: 1920, size: "l" }); assert.match(big, /Style: host,IBM Plex Sans,81,/); }); // ---- real renders --------------------------------------------------------------- const have = ["ffmpeg", "ffprobe"].every((b) => spawnSync(b, ["-version"]).status === 0) && /\bass\b/.test(String(spawnSync("ffmpeg", ["-hide_banner", "-filters"]).stdout)); const FPS = 30; const PALETTE = { bg: "#000000", fg: "#ffffff", muted: "#888888", accent: "#c8752a", amber: "#ffc860" }; const RENDER = { width: 320, height: 180, fps: FPS, audioRate: 48000, audioChannels: 2, preset: "ultrafast", transition: 0, headerHeight: 0, footerHeight: 0, qr: false, palette: PALETTE, fontRegular: MONO_FONT_FILE, fontBold: MONO_BOLD_FONT_FILE, fetchPad: 0, snapWindow: 0.05, silenceMinDur: 0.1, }; const CHANNEL = "synth"; const VIDEO = "vid1"; // The corpus record the build reads the clip's metadata from. { const dir = path.join(CORPUS, CHANNEL, "data", VIDEO); mkdirSync(dir, { recursive: true }); writeFileSync(path.join(CORPUS, CHANNEL, "config.json"), JSON.stringify({ name: "Synth" })); writeFileSync(path.join(dir, "transcript.cues.json"), JSON.stringify({ id: VIDEO, title: "Synthetic", duration: 12, uploadDate: "20240102", cues: [{ start: 0.2, end: 11.8, text: "filler words only" }] })); writeFileSync(path.join(dir, "metadata.info.json"), JSON.stringify({ id: VIDEO, title: "Synthetic", duration: 12 })); } /** * A project: one clip of vid1 (1-7 s), its window in out/clips-raw (12 s of a * 640x360 black picture with a white bar at x 400-440, and a 440 Hz tone, * lavfi sine's 1/8 times `amp`), reactions.json (the subject 0-4 s and 8-12 s, the host 4-8 s) and * words.json (a word every half second). */ async function project(render = {}, { clip = {}, amp = 0.5, rx = true } = {}) { const root = mkdtempSync(path.join(os.tmpdir(), "rtv-look-")); mkdirSync(path.join(root, "out", "clips-raw"), { recursive: true }); const raw = path.join(root, "out", "clips-raw", `${VIDEO}_0.00-12.00.mp4`); const r = spawnSync("ffmpeg", [ "-v", "error", "-y", "-f", "lavfi", "-i", `color=c=black:s=640x360:r=${FPS}:d=12`, "-f", "lavfi", "-i", `sine=frequency=440:sample_rate=48000:duration=12`, "-filter_complex", `[0:v]drawbox=x=400:y=0:w=40:h=360:color=white:t=fill[v];[1:a]volume=${amp}[a]`, "-map", "[v]", "-map", "[a]", "-c:v", "libx264", "-preset", "ultrafast", "-c:a", "aac", "-shortest", raw, ]); assert.equal(r.status, 0, String(r.stderr)); if (rx) { await writeFile(path.join(root, "reactions.json"), JSON.stringify({ version: 1, source: { channel: CHANNEL, video: VIDEO, duration: 12, words: "words.json" }, speakers: [{ index: 0, role: "host", label: "Host", how: "auto" }, { index: 1, role: "subject", label: "Subject", how: "auto" }], turns: [{ start: 0, end: 4, speaker: 1 }, { start: 4, end: 8, speaker: 0 }, { start: 8, end: 12, speaker: 1 }], laughs: [], moments: [], proposals: [], })); const words = []; for (let t = 0.25; t < 11.5; t += 0.5) words.push({ w: `w${Math.round(t * 2)}`, start: t, end: t + 0.3 }); await writeFile(path.join(root, "words.json"), JSON.stringify({ words })); } const manifestPath = path.join(root, "video.manifest.json"); await writeFile(manifestPath, JSON.stringify({ slug: "look", title: "Look", provenance: { channelSlug: CHANNEL, channelsDir: CORPUS }, render: { ...RENDER, ...render }, timeline: [{ type: "clip", id: "c1", channel: CHANNEL, video: VIDEO, start: 1, end: 7, cite: 1, quote: "q", ...clip }], })); return { root, manifestPath, raw }; } const md5 = (f) => spawnSync("md5sum", [f]).stdout.toString().split(" ")[0]; const quiet = () => setProgressMode(() => {}); /** One frame of `file` as rgb24: `{ w, h, px(x, y) => [r, g, b] }`. */ function frame(file, n) { const p = spawnSync("ffprobe", ["-v", "error", "-select_streams", "v:0", "-show_entries", "stream=width,height", "-of", "csv=p=0", file]); const [w, h] = String(p.stdout).trim().split(",").map(Number); const r = spawnSync("ffmpeg", ["-v", "error", "-i", file, "-vf", `select='eq(n,${n})'`, "-frames:v", "1", "-f", "rawvideo", "-pix_fmt", "rgb24", "-"], { maxBuffer: 1 << 26 }); assert.equal(r.status, 0, String(r.stderr)); const buf = r.stdout; return { w, h, px: (x, y) => { const i = (y * w + x) * 3; return [buf[i], buf[i + 1], buf[i + 2]]; } }; } /** The mean colour of the bright pixels (max channel > 140) in a box, and how many. */ function brightIn(f, x0, y0, x1, y1) { let n = 0; const sum = [0, 0, 0]; for (let y = y0; y < y1; y += 1) { for (let x = x0; x < x1; x += 1) { const c = f.px(x, y); if (Math.max(...c) > 140) { n += 1; sum[0] += c[0]; sum[1] += c[1]; sum[2] += c[2]; } } } return { n, mean: n ? sum.map((v) => v / n) : null }; } test("render: without the new keys (absent or null) the cut is byte for byte the same", { skip: !have && "needs ffmpeg with libass" }, async () => { quiet(); const a = await project({}); const b = await project({ captions: null, loudness: null }); try { await buildVideo({ manifestPath: a.manifestPath, opts: { noNetwork: true } }); await buildVideo({ manifestPath: b.manifestPath, opts: { noNetwork: true } }); for (const f of ["look.mp4", "sourced/segments/c1.mp4", "sourced/segments/c1.cut.json"]) { assert.equal(md5(path.join(a.root, "out", f)), md5(path.join(b.root, "out", f)), f); } const rec = JSON.parse(await readFile(path.join(a.root, "out", "sourced", "segments", "c1.cut.json"), "utf8")); assert.equal(rec.loudness, undefined); assert.equal(rec.captions, undefined); } finally { await rm(a.root, { recursive: true, force: true }); await rm(b.root, { recursive: true, force: true }); } }); test("render: render.loudness brings a quiet clip to its target within ±0.5 LU", { skip: !have && "needs ffmpeg with libass" }, async () => { quiet(); const p = await project({ loudness: { target: -16 } }, { amp: 0.5 }); try { const before = await measureLoudness(p.raw, 1, 7); assert.ok(before < -24 && before > -40, `the source is quiet, not silent: ${before}`); const r = await buildVideo({ manifestPath: p.manifestPath, opts: { noNetwork: true } }); const seg = path.join(p.root, "out", "sourced", "segments", "c1.mp4"); const after = await measureLoudness(seg, 0, 6); assert.ok(Math.abs(after - -16) <= 0.5, `segment ${after} LUFS`); assert.ok(Math.abs((await measureLoudness(r.out, 0, 6)) - -16) <= 0.5, "the cut"); const rec = JSON.parse(await readFile(seg.replace(/\.mp4$/, ".cut.json"), "utf8")); assert.equal(rec.loudness.target, -16); assert.ok(Math.abs(rec.loudness.gain - (-16 - before)) < 0.6, JSON.stringify(rec.loudness)); } finally { await rm(p.root, { recursive: true, force: true }); } }); test("render: speaker captions -- on their frame, the subject sky on the right, the host amber on the left", { skip: !have && "needs ffmpeg with libass" }, async () => { quiet(); const p = await project({ width: 640, height: 360, captions: { style: "speakers" } }); try { await buildVideo({ manifestPath: p.manifestPath, opts: { noNetwork: true } }); const segDir = path.join(p.root, "out", "sourced", "segments"); const rec = JSON.parse(await readFile(path.join(segDir, "c1.cut.json"), "utf8")); assert.deepEqual([rec.start, rec.end], [1, 7]); assert.equal(rec.captions.words, "words.json"); const ass = await readFile(path.join(segDir, "c1.captions.ass"), "utf8"); const events = ass.split("\n").filter((l) => l.startsWith("Dialogue:")); // Source 1.25 is the first word: 0.25 s into the segment; the host's first (4.25) at 3.25. assert.match(events[0], /^Dialogue: 0,0:00:00\.25,[^,]+,subject,/); const host = events.find((l) => /,host,/.test(l)); assert.match(host, /^Dialogue: 0,0:00:03\.25,/); const seg = path.join(segDir, "c1.mp4"); // The bar (x 400-440 of 640) is white in every frame; the captions are under y 260. const box = (f, side) => (side === "left" ? brightIn(f, 0, 260, 300, 345) : brightIn(f, 445, 260, 640, 345)); // To the frame: nothing on frame 6 (0.2 s), the subject's line on frame 8 (0.267 s). assert.equal(box(frame(seg, 6), "right").n, 0, "no caption before its first word"); const sub = box(frame(seg, 8), "right"); assert.ok(sub.n > 30, `the subject's line is up: ${sub.n} px`); assert.ok(sub.mean[2] > sub.mean[0] + 60, `sky: ${sub.mean.map(Math.round)}`); assert.equal(box(frame(seg, 8), "left").n, 0, "the subject is on the right only"); // The host from 3.25 s: frame 99 (3.3 s) amber on the left. const h = box(frame(seg, 99), "left"); assert.ok(h.n > 30, `the host's line is up: ${h.n} px`); assert.ok(h.mean[0] > h.mean[2] + 80, `amber: ${h.mean.map(Math.round)}`); assert.equal(box(frame(seg, 99), "right").n, 0, "the host is on the left only"); } finally { await rm(p.root, { recursive: true, force: true }); } }); test("render: a short -- 1080x1920, its crop, large captions, loudness, in /shorts/", { skip: !have && "needs ffmpeg with libass" }, async () => { quiet(); // The crop's centre on the bar (x 400-440 of 640): [0.5, 0, 0.3164, 1] centres at x 421. const p = await project({ headerHeight: 56, qr: { margin: 10 } }, { clip: { vertical: { crop: [0.5, 0, 0.3164, 1] } } }); try { const r = await buildVideo({ manifestPath: p.manifestPath, opts: { noNetwork: true, short: "c1" } }); const out = path.join(p.root, "shorts", "c1.mp4"); assert.equal(r.out, out); const probe = spawnSync("ffprobe", ["-v", "error", "-select_streams", "v:0", "-show_entries", "stream=width,height", "-of", "csv=p=0", out]); assert.equal(String(probe.stdout).trim(), "1080,1920"); // The crop: 202x360 at x 320, so the bar is at 80-120 of 202 -> 428-642 of 1080. const f = frame(out, 15); assert.ok(Math.min(...f.px(535, 400)) > 200, `the bar in the middle: ${f.px(535, 400)}`); assert.ok(Math.max(...f.px(200, 400)) < 40, "black left of it"); assert.ok(Math.max(...f.px(900, 400)) < 40, "black right of it"); // No header: the top rows are the picture (black beside the bar). assert.ok(Math.max(...f.px(100, 10)) < 40, "no header"); const rec = JSON.parse(await readFile(path.join(p.root, "shorts", "c1.json"), "utf8")); assert.deepEqual(rec.crop, [0.5, 0, 0.3164, 1]); assert.equal(rec.width, 1080); assert.equal(rec.loudness.target, -16); assert.ok(rec.captions.lines > 0); // Large captions on the subject's side. const ass = await readFile(path.join(p.root, "out", "shorts-work", "segments", "c1.captions.ass"), "utf8"); assert.match(ass, /Style: subject,IBM Plex Sans,81,/); assert.ok(Math.abs((await measureLoudness(out, 0, 6)) - -16) <= 0.5, "loudness"); // The cut's own segments are untouched. assert.equal(spawnSync("test", ["-e", path.join(p.root, "out", "sourced", "segments", "c1.mp4")]).status, 1); } finally { await rm(p.root, { recursive: true, force: true }); } });