Skip to content
Query.Farm
Talk with Us

Test a TypeScript worker

Use the project’s unit test runner for business logic, then verify the launched worker through DuckDB or Haybarn. The shared testing guide supplies a portable manifest and SQL verifier for any worker language.

For a Node project using tsx, the manifest can use:

"worker": ["node", "--import", "tsx", "worker.ts"]

For compiled JavaScript, build first and point the manifest at the emitted file. For Bun, use the project’s Bun command. Install the SDK’s declared Arrow/RPC peer dependencies and commit the lockfile. Build output and logs must not be written into the stdio protocol stream.

BIGINT values are JavaScript bigint. Test values above the exact integer range of Number, plus nulls, empty input, and more than one Arrow batch. Verify the advertised schema and the returned row count. When an API returns numbers as strings, preserve the precision explicitly.

Keep the SDK protocol version compatible with the engine extension. A direct RPC client test can pass even when the engine and worker are mismatched, so run the SQL check as well.

The TypeScript fixture includes dependency pins and executable SQL assertions. The agent quickstart prepares a TypeScript build-and-test prompt.