2024-06-07 10:34:19 -07:00
|
|
|
import child_process from "child_process";
|
|
|
|
import fs from "fs";
|
|
|
|
|
|
|
|
test("ensure dryRun crawl only writes pages and logs", async () => {
|
|
|
|
child_process.execSync(
|
2024-10-31 10:24:58 -07:00
|
|
|
'docker run -v $PWD/test-crawls:/crawls webrecorder/browsertrix-crawler crawl --url https://old.webrecorder.net/ --generateWACZ --text --collection dry-run-wr-net --combineWARC --rolloverSize 10000 --limit 2 --title "test title" --description "test description" --warcPrefix custom-prefix --dryRun --exclude community',
|
2024-06-07 10:34:19 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
const files = fs.readdirSync("test-crawls/collections/dry-run-wr-net").sort();
|
|
|
|
expect(files.length).toBe(2);
|
|
|
|
expect(files[0]).toBe("logs");
|
|
|
|
expect(files[1]).toBe("pages");
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|