Protecting a Growing TypeScript Codebase with AI Test Generation: How ExpressoTS Used Early

Table of Contents
Early is an AI code generation agent that autonomously writes executable unit test code as part of the CI pipeline.
As the ExpressoTS codebase grew, test coverage no longer reflected real confidence in the system. Using Early, an AI code generation agent that writes executable unit test code, the maintainers increased coverage across an existing TypeScript repository, uncovered real bugs, and turned tests into a meaningful protection layer, achieving close to 90% coverage in hours instead of weeks, without slowing development.
Image: Sidebar information
Project Snapshot

ExpressoTS is a popular open-source Node.js and TypeScript framework for building scalable and maintainable server-side applications. It is actively maintained by a small core team alongside a growing open-source community and widely adopted in real-world systems.
For open-source projects at this level of usage, test coverage is more than an internal engineering metric, it’s a signal of trust. Companies evaluating OSS often look for strong test coverage (commonly 80% or higher) as an indicator that a project is well-tested, actively maintained, and safe to adopt in production.
As ExpressoTS grew and its codebase expanded to thousands of lines of production logic, maintaining that level of coverage, and the confidence behind it, became critical to the project’s long-term sustainability.
As ExpressoTS grew, testing didn’t scale at the same pace.
Some areas of the codebase were well tested, while others became harder to change, not because they were complex, but because it wasn’t clear what might break. Coverage metrics existed, but they didn’t reflect where the real risk lived , where PR coverage provides a more practical signal of quality.
The maintainers experimented with general-purpose AI tools like ChatGPT to generate tests. While the results were usable, the process quickly became a bottleneck. Each test required manual context sharing, adjustments, and review. Creating a single usable test could take 10–15 minutes, making large-scale coverage improvements unrealistic.
Testing was possible, but it wasn’t sustainable.
The goal wasn’t to write tests faster.
ExpressoTS needed a way to systematically raise the safety level of an existing codebase, increasing coverage across the repository, surfacing hidden bugs and edge cases, and protecting core logic without slowing development or overburdening contributors.
In short, they needed tests that would act as a protection layer, not just a reporting metric.
Early was introduced as an IDE-native AI agent for unit test generation.
Instead of prompting function by function, Early derived its understanding directly from the codebase. Once installed in the ExpressoTS IDE environment, it automatically worked with their existing Jest setup and generated executable unit tests without manual context sharing. This shifted testing from a manual, incremental task to something that could operate at the level of the repository, understanding dependencies, configuration, and behavior in context. This shift reflects a broader move toward autonomous test code generation that operates continuously at the codebase level rather than through manual prompts.
Today, Early also runs as an autonomous agent directly in CI environments, such as GitHub Actions. Operating continuously, it generates and validates higher-quality tests automatically as the codebase evolves, ensuring that new changes are protected without relying solely on manual intervention or developer attention.

Within a few hours, Early generated hundreds of unit tests across the ExpressoTS codebase. The results told a clear story and the code was understood much better through the test
The failed tests weren’t noise. They revealed missing validations, unhandled edge cases, and assumptions that had never been explicitly enforced. Testing became a discovery process, not just validation.
By using Early, ExpressoTS rapidly increased coverage across an existing repository, uncovered real bugs, and strengthened protection around core logic, all without slowing development or overwhelming contributors. What would have taken weeks of manual effort was achieved in hours, allowing maintainers to focus on improving the framework instead of writing repetitive tests.
But this story isn’t really about ExpressoTS.
It reflects a pattern that shows up in most growing codebases, including teams adopting AI-generated code at enterprise scale where coverage metrics improve, yet confidence doesn’t always follow. ExpressoTS used Early to change that dynamic, shifting testing from a checkbox to a safety net. Coverage became a side effect of protection, not the goal itself, a shift that aligns with approaches like the Early Quality Score (EQS), which focus on confidence rather than coverage alone.
That’s when teams stop being afraid to change their code, and start trusting it again.
