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

* switch base image to chrome/chromium 105 with node 18.x * convert all source to esm for node 18.x, remove unneeded node-fetch dependency * ci: use node 18.x, update to latest actions * tests: convert to esm, run with --experimental-vm-modules * tests: set higher default timeout (90s) for all tests * tests: rename driver test fixture to .mjs for loading in jest * bump to 0.8.0
33 lines
862 B
JavaScript
33 lines
862 B
JavaScript
import util from "util";
|
|
import {exec as execCallback } from "child_process";
|
|
|
|
const exec = util.promisify(execCallback);
|
|
|
|
|
|
test("check that the collection name is properly validated", async () => {
|
|
let passed = "";
|
|
|
|
try{
|
|
await exec("docker run -v $PWD/test-crawls:/crawls webrecorder/browsertrix-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 () => {
|
|
let passed = "";
|
|
|
|
try{
|
|
await exec("docker run webrecorder/browsertrix-crawler crawl --url http://www.example.com/ --collection invalid_c!!ollection-nameisvalid");
|
|
passed = true;
|
|
}
|
|
catch(e){
|
|
passed = false;
|
|
}
|
|
expect(passed).toBe(false);
|
|
|
|
});
|