Skip to content

toolmark-monorepo / @toolmark/testing / createTestToolmark

Function: createTestToolmark() ​

createTestToolmark(opts?): Toolmark & TestToolmark

Defined in: packages/testing/src/test-toolmark.ts:56

Creates a Toolmark registry for Vitest and other node-environment tests. Production confirmation modes stay intact (spec §11.6 amended): inapp/test default to deferred, webmcp/mcp/tour stay inline. An inline confirm handler is always installed (scripted by inline, or opts.confirm when given), every request it sees is recorded in .confirms, every settled call is recorded in .calls, .approveAll() approves every pending deferred confirmation, and __environment is forced to 'browser' so registration is never inert. Never imports @playwright/test.

Parameters ​

opts? ​

CreateTestToolmarkOptions = {}

ToolmarkOptions plus inline.

Returns ​

Toolmark & TestToolmark

The registry with .calls, .confirms and .approveAll() mixed onto the same object: never a copy, since the registry's internal state is keyed by the object's own identity.