All stories
3 min read

Bun adds TypeScript checking as aimock makes broken model output testable

Bun 1.4.3 introduces a built-in checker for TypeScript projects. CopilotKit's aimock can now feed malformed model responses into tests so applications can verify how they recover. The announcements were published October 10 and 12, respectively.

Two line-art test panels show a TypeScript error being detected and a malformed AI tool call being contained
Original illustration of two developer-testing workflows; not a screenshot of Bun or aimock.

Bun brings type checking into its command line

Bun released version 1.4.3 on October 10 with bun check, a built-in TypeScript type checker. Bun says it reads a project's tsconfig.json and reports type errors without requiring the TypeScript package to be installed. Developers can also use bun run --check to stop a script when checking fails, or add --check to Bun's test and build commands. For frontend teams already using Bun to run scripts, this puts an additional check in the same toolchain.

This is not a replacement for every TypeScript tool. Bun says bun check only checks types: it does not emit JavaScript or declaration files and does not provide a language server. Editors therefore continue to use their TypeScript integration. The checker is a port of typescript-go; Bun reports full conformance with the TypeScript 7.0.2 test suite, but project-specific behavior still deserves a trial before a team changes its CI checks.

The speed figures belong to Bun's own benchmark

Bun measured bun check at roughly three to six times the speed of tsc 7.0.2 across several repositories on a 16-core Apple silicon Mac, with lower memory use in those runs. Those are vendor measurements under specified conditions, not a promise for every codebase or machine. The release also documents cases where its comparison against tsc is not yet identical.

A useful adoption path is to run both checkers on the same repository and compare diagnostics before changing the required build gate. That recommendation follows from Bun's published limitations and test results; it is not an instruction from the release to remove tsc immediately.

aimock can supply the model output an app hopes never to see

CopilotKit announced on October 12 that its open-source aimock server can inject nine kinds of model-output faults into otherwise valid API responses. The catalog includes malformed tool arguments, schema violations, unknown tool names, duplicate tool-call IDs, empty answers, and refusals. A test can choose a fault for one response, then send a normal response on the next request to check whether an application's parser and retry logic behave as intended.

For example, a deliberately broken argument string should not cause the application to execute the named tool. The test can then check that any retry is bounded, the conversation remains usable, and the tool runs only after acceptable arguments arrive. aimock supplies the faulty response; the application still has to implement its own validation, recovery, and assertions.

A local failure test is evidence of behavior, not provider frequency

aimock records which fault it prepared so a test can confirm that the intended case was exercised. Its documentation also says support varies by API format and streaming mode, and some modeled outputs have not been observed in a native provider response. A seeded configuration can reproduce rate decisions for a fixed request order, but concurrent scheduling can change that order.

These boundaries matter when interpreting a passing test: it shows how an application handles the simulated response, not how often a real model will produce it or whether every provider formats it identically. Bun and aimock address different failure points in a web application's development cycle—static code errors and unpredictable model responses—without either tool removing the need for application-specific checks.

Sources & further reading