* initial commit? * Address PR feedback on extractor discovery and startup resilience * Address latest PR review comments * fix city resolution fallback when input parses empty * address PR feedback on extractor registry and pipeline validation * address copilot comments on manifests and registry startup * fix extractor discovery export handling and env isolation in tests * enforce duplicate manifest id failures in strict mode * Fix remaining extractor registry and runtime review comments * docs * docs * test all, logic remains in extractors * Address PR review feedback on extractor registry and validation * Revert extractor moduleResolution to bundler * Enforce shared city filtering across all discovery sources * Deduplicate extractor strict city post-filtering
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { parseJobSpyProgressLine } from "../src/run";
|
|
|
|
describe("parseJobSpyProgressLine", () => {
|
|
it("parses term_start progress lines", () => {
|
|
const event = parseJobSpyProgressLine(
|
|
'JOBOPS_PROGRESS {"event":"term_start","termIndex":1,"termTotal":3,"searchTerm":"engineer"}',
|
|
);
|
|
|
|
expect(event).toEqual({
|
|
type: "term_start",
|
|
termIndex: 1,
|
|
termTotal: 3,
|
|
searchTerm: "engineer",
|
|
});
|
|
});
|
|
|
|
it("parses term_complete progress lines", () => {
|
|
const event = parseJobSpyProgressLine(
|
|
'JOBOPS_PROGRESS {"event":"term_complete","termIndex":2,"termTotal":3,"searchTerm":"frontend","jobsFoundTerm":17}',
|
|
);
|
|
|
|
expect(event).toEqual({
|
|
type: "term_complete",
|
|
termIndex: 2,
|
|
termTotal: 3,
|
|
searchTerm: "frontend",
|
|
jobsFoundTerm: 17,
|
|
});
|
|
});
|
|
|
|
it("returns null for malformed payloads", () => {
|
|
expect(parseJobSpyProgressLine("JOBOPS_PROGRESS {bad json")).toBeNull();
|
|
expect(parseJobSpyProgressLine("JOBOPS_PROGRESS {}")).toBeNull();
|
|
});
|
|
|
|
it("returns null for non-progress lines", () => {
|
|
expect(parseJobSpyProgressLine("Found 20 jobs")).toBeNull();
|
|
});
|
|
});
|