const host = createTestHost({
plan: app.plan,
configureServices: (services) => {
services.replaceSingleton(ProjectRepository, () => fakeRepository);
},
});
await host.start();
await expect(host.application.commands.execute(Refresh)).resolves.toBe(3);
await host.stop();
expect(host.leaks().commands).toEqual([]);
Runs a production
ApplicationPlanon fake capabilities.The plan is not recompiled or simplified for tests—the same descriptors, runtime preflight, host and stop path are used unless the caller explicitly replaces a service. What normally differs is only which capability implementations are bound.
The fakes are intentionally observable rather than visual: tests script user input and platform events, then inspect recorded calls/state. Shared contract suites keep important fake/adapter semantics aligned, but only a real Extension Host can prove behavior that belongs to VS Code itself.