aboutsummaryrefslogtreecommitdiff
path: root/castle-search/test/extraction-config.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'castle-search/test/extraction-config.test.ts')
-rw-r--r--castle-search/test/extraction-config.test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/castle-search/test/extraction-config.test.ts b/castle-search/test/extraction-config.test.ts
new file mode 100644
index 0000000..43d2108
--- /dev/null
+++ b/castle-search/test/extraction-config.test.ts
@@ -0,0 +1,16 @@
+import assert from "node:assert/strict";
+import { test } from "node:test";
+
+import { getEngine } from "../src/engines.ts";
+
+test("duckduckgo can tell a genuine zero-hit page from broken markup", () => {
+ // Its "no results" notice is itself a `.result`, so without a marker an empty
+ // search looks like an extractor failure.
+ assert.equal(getEngine("duckduckgo").extraction.emptyMarker, ".no-results");
+});
+
+test("brave falls back to main when #results is absent", () => {
+ const roots = getEngine("brave").extraction.roots;
+ assert.ok(roots.includes("main"));
+ assert.equal(roots[0], "#results");
+});