Skip to content

Commit

Permalink
update test for invalid selector
Browse files Browse the repository at this point in the history
  • Loading branch information
ikreymer committed Nov 8, 2024
1 parent 5d5f518 commit 6d4ad9c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/custom_selector.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,17 @@ test("test custom selector crawls JS files as pages", async () => {
});


test("test invalid selector, no pages extracted", async () => {
test("test invalid selector, crawl fails", async () => {
let failed = false;
try {
child_process.execSync(
"docker run -v $PWD/test-crawls:/crawls webrecorder/browsertrix-crawler crawl --url https://www.iana.org/ --collection custom-sel-invalid --selectLinks \"script[\"",
);
} catch (error) {
console.log(error);
failed = true;
}

const crawledExtraPages = fs.readFileSync(
"test-crawls/collections/custom-sel-invalid/pages/extraPages.jsonl",
"utf8",
);
expect(crawledExtraPages.trim().split("\n").length).toBe(1);
expect(failed).toBe(true);
});


0 comments on commit 6d4ad9c

Please sign in to comment.