Plugin SDK Testing
OpenClaw keeps the public testing surface intentionally small. Useopenclaw/plugin-sdk/testing for helpers that are stable enough to support
for plugin authors, and build small plugin-local doubles for everything else.
Public testing helpers
Current helpers include:createWindowsCmdShimFixture(...)installCommonResolveTargetErrorCases(...)shouldAckReaction(...)removeAckReactionAfterReply(...)
OpenClawConfigPluginRuntimeRuntimeEnvChannelAccountSnapshotChannelGatewayContext
Example: Windows command shim fixture
Example: shared target-resolution failures
Runtime doubles
There is no catch-allcreateTestRuntime() export on the public SDK today.
Instead:
- use the public testing helpers where they fit
- use
plugin-sdk/runtimefor small runtime adapters - build tiny plugin-local runtime doubles for the rest
Test guidance
- Prefer focused unit tests over giant end-to-end harnesses.
- Import pure types from focused SDK subpaths in tests.
- Keep plugin-local test doubles small and explicit.
- Avoid depending on non-exported OpenClaw test internals.