mirror of
https://github.com/webrecorder/browsertrix-crawler.git
synced 2025-10-19 14:33:17 +00:00

replace webrecorder.net -> old.webrecorder.net to fix tests relying on old website for now
28 lines
863 B
JavaScript
28 lines
863 B
JavaScript
import child_process from "child_process";
|
|
import fs from "fs";
|
|
|
|
test("set rollover to 500K and ensure individual WARCs rollover, including screenshots", async () => {
|
|
child_process.execSync(
|
|
"docker run -v $PWD/test-crawls:/crawls webrecorder/browsertrix-crawler crawl --url https://old.webrecorder.net/ --limit 5 --exclude community --collection rollover-500K --rolloverSize 500000 --screenshot view"
|
|
);
|
|
|
|
const warcLists = fs.readdirSync("test-crawls/collections/rollover-500K/archive");
|
|
|
|
let main = 0;
|
|
let screenshots = 0;
|
|
|
|
for (const name of warcLists) {
|
|
if (name.startsWith("rec-")) {
|
|
main++;
|
|
} else if (name.startsWith("screenshots-")) {
|
|
screenshots++;
|
|
}
|
|
}
|
|
|
|
// expect at least 6 main WARCs
|
|
expect(main).toBeGreaterThan(5);
|
|
|
|
// expect at least 2 screenshot WARCs
|
|
expect(screenshots).toBeGreaterThan(1);
|
|
|
|
});
|