browsertrix-crawler/tests/redis_crawl_state.js
Emma Segal-Grossman 2a49406df7
Add Prettier to the repo, and format all the files! (#428)
This adds prettier to the repo, and sets up the pre-commit hook to
auto-format as well as lint.
Also updates ignores files to exclude crawls, test-crawls, scratch, dist as needed.
2023-11-09 16:11:11 -08:00

19 lines
706 B
JavaScript

import child_process from "child_process";
test("ensure crawl run with redis passes", async () => {
const redis = child_process.spawn(
"docker run -d --name test-crawl-redis -p 6379:6379 redis",
);
child_process.execSync(
"docker run -v $PWD/test-crawls:/crawls webrecorder/browsertrix-crawler crawl --url http://www.example.com/ --generateWACZ --text --collection redis-crawl --redisStoreUrl redis://127.0.0.1:6379 --workers 2",
);
redis.kill("SIGINT");
});
test("check that wacz created is valid", () => {
child_process.execSync(
"docker run -v $PWD/test-crawls:/crawls webrecorder/browsertrix-crawler wacz validate --file collections/redis-crawl/redis-crawl.wacz",
);
});