mirror of
https://github.com/prdlk/jobyssey.git
synced 2026-11-08 16:07:38 +00:00
feat: add skills
This commit is contained in:
1 parent
6984212b17
commit
c50aa92862
150 files changed
+12702
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, test } from "bun:test"
|
||||
import { runCLI, parseJSON } from "./helpers"
|
||||
|
||||
describe("wellfound-cli", () => {
|
||||
test("search returns real results for a common role", async () => {
|
||||
const res = await runCLI(["search", "-q", "senior software engineer", "--location", "new-york", "--limit", "5", "--no-description"])
|
||||
expect(res.exitCode).toBe(0)
|
||||
const json = parseJSON<{ meta: { count: number }; results: { id: string; title: string; company: string | null; location: string | null; date: string | null; url: string }[] }>(res)
|
||||
expect(json.results.length).toBeGreaterThan(0)
|
||||
for (const r of json.results) {
|
||||
expect(r.id).toBeTruthy(); expect(r.title).toBeTruthy(); expect(r.url).toContain("wellfound.com/jobs/")
|
||||
expect(r).toHaveProperty("company"); expect(r).toHaveProperty("location"); expect(r).toHaveProperty("date")
|
||||
}
|
||||
})
|
||||
test("bogus flag exits 1 with JSON error on stderr", async () => {
|
||||
const res = await runCLI(["search", "-q", "x", "--bogus"])
|
||||
expect(res.exitCode).toBe(1); expect(JSON.parse(res.stderr)).toHaveProperty("error")
|
||||
})
|
||||
test("missing query exits 1 with JSON error", async () => {
|
||||
const res = await runCLI(["search"])
|
||||
expect(res.exitCode).toBe(1); expect(JSON.parse(res.stderr).code).toBe("NO_QUERY")
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user