fix(backfill): type spec queue mock so production nest build compiles it
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled

The prod docker build runs `nest build`, which compiles spec files too —
the untyped `vi.fn(async () => undefined)` mock made `queue.add.mock.calls[i]`
a zero-length tuple, so the destructures tripped TS2493/TS2352 and failed
`pnpm build` (tsc --noEmit had skipped the spec). Type the mock args as
unknown[]. No behaviour change; tests still 7/7, `pnpm build` green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 11:45:28 +03:00
parent 0de6bd3faa
commit a7678acbe1

View File

@@ -18,7 +18,9 @@ function makeDb(limitResults: unknown[][]) {
function makeDeps(opts: { waiting: number; limitResults: unknown[][] }) {
const queue = {
add: vi.fn(async () => undefined),
// typed args so `.mock.calls[i]` is `unknown[]` (not a 0-length tuple) — the
// production `nest build` compiles spec files and rejects tuple-index access.
add: vi.fn((..._args: unknown[]) => Promise.resolve(undefined)),
getJobCounts: vi.fn(async () => ({ waiting: opts.waiting, delayed: 0, active: 0 })),
};
const redis = {