mirror of
https://github.com/webrecorder/browsertrix-crawler.git
synced 2025-10-19 06:23:16 +00:00

* pending request wait: - instead of waiting for 5s, check redis key 'pywb:{coll}:pending' to see if any pending requests are still pending - keep checking key until pending requests are at 0 - requires latest pywb 2.6.0+ - should fix #44 * fix test to no longer look for waiting for 5s message * lint settings and fixes: allow constant in loops, add lint command to script * chrome: bump default image to chrome:90 image
32 lines
822 B
JavaScript
32 lines
822 B
JavaScript
const util = require("util");
|
|
const exec = util.promisify(require("child_process").exec);
|
|
|
|
test("check that the collection name is properly validation", async () => {
|
|
jest.setTimeout(30000);
|
|
let passed = "";
|
|
|
|
try{
|
|
await exec("docker-compose run crawler crawl --url http://www.example.com/ --collection valid_collection-nameisvalid");
|
|
passed = true;
|
|
}
|
|
catch (error) {
|
|
passed = false;
|
|
}
|
|
expect(passed).toBe(true);
|
|
});
|
|
|
|
|
|
test("check that the collection name is not accepted if it doesn't meets our standards", async () => {
|
|
jest.setTimeout(30000);
|
|
let passed = "";
|
|
|
|
try{
|
|
await exec("docker-compose run crawler crawl --url http://www.example.com/ --collection invalid_c!!ollection-nameisvalid");
|
|
passed = true;
|
|
}
|
|
catch(e){
|
|
passed = false;
|
|
}
|
|
expect(passed).toBe(false);
|
|
|
|
});
|