mirror of
https://github.com/webrecorder/browsertrix-crawler.git
synced 2025-10-19 14:33:17 +00:00
lang code fixes: (#834)
- validate --lang values, fail immediately with invalid iso-639-1 country code - ignore --lang value when using profile, print warning that profile language takes precedence - fixes #833
This commit is contained in:
parent
e39d5a31eb
commit
71de8d6582
5 changed files with 44 additions and 1 deletions
23
tests/lang-code.test.js
Normal file
23
tests/lang-code.test.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { execSync } from "child_process";
|
||||
|
||||
test("run crawl with invalid lang", () => {
|
||||
let status = 0;
|
||||
try {
|
||||
execSync(`docker run --rm webrecorder/browsertrix-crawler crawl --url https://webrecorder.net/feed.xml --lang e --limit 1`);
|
||||
} catch (e) {
|
||||
status = e.status;
|
||||
}
|
||||
expect(status).toBe(17);
|
||||
});
|
||||
|
||||
test("run crawl with valid lang", () => {
|
||||
let status = 0;
|
||||
try {
|
||||
execSync(`docker run --rm webrecorder/browsertrix-crawler crawl --url https://webrecorder.net/feed.xml --lang en --limit 1`);
|
||||
} catch (e) {
|
||||
status = e.status;
|
||||
}
|
||||
expect(status).toBe(0);
|
||||
});
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue