Skip to content

Conversation

@manzt
Copy link
Collaborator

@manzt manzt commented Oct 6, 2025

Adds a test harness (TestVsCode) that simulates the VSCode environment. This harness provides a controlled context where VsCode state can be manipulated and observed in our tests.

We can now programmatically create scenarios (opening notebooks, executing cells, triggering commands) and verify the resulting system state.

const vscode = yield* TestVsCode.make();

yield* vscode.addNotebookDocument(/* ... */)

yield* Effect.provide(
  Effect.gen(function* () {
    const {commands}  = yield* VsCode;
    yield* commands.registerCommand("myCommand", Effect.void);
  }),
  vscode.layer, // <- Provides the VsCode service
);

expect(yield* vscode.snapshot()).toMatchInlineSnapshot(`{
  commands: ["myCommand"],
  serializers: [],
  controllers: [],
}`)

@manzt manzt force-pushed the push-svrqyrnlptrx branch from 54b1a48 to 892fdf1 Compare October 6, 2025 19:33
@manzt manzt merged commit 0c489c9 into main Oct 6, 2025
6 checks passed
@manzt manzt deleted the push-svrqyrnlptrx branch October 6, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants