Test the npm Package, Not Just the Monorepo | Neura Market
    Neura Market
    Neura Market
    /CoPilot
    Marketplace
    Directories
    Resources
    CoPilot
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeekCoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityPluginsTrending
    CoPilotBlogTest the npm Package, Not Just the Monorepo
    Back to Blog
    Test the npm Package, Not Just the Monorepo
    typescript

    Test the npm Package, Not Just the Monorepo

    Raju Dandigam November 13, 2026
    0 views

    A tracing adapter can pass its internal tests while capturing nothing in an installed...

    A tracing adapter can pass its internal tests while capturing nothing in an installed application.

    The imports resolve. The tool executes. No exception tells the developer that the trace is incomplete. A test that only checks the tool's return value misses the failure entirely.

    I maintain AgentInspect. A public external evaluation of the older 6.29.1 release examined this boundary with the MCP SDK. It documented capture/runtime-identity and wrapper-compatibility problems. That repository is a historical reproduction, not a verdict on today's release.

    For this article, I built a separate installed-package smoke test against agent-inspect@6.31.35, @agent-inspect/mcp@6.31.35, and MCP SDK 1.31.0. The question was narrower than “does the library work?”: does the published integration observe the calls made by a real SDK consumer?

    Package topology can change runtime behavior

    Imagine that a root package creates an asynchronous run context while an adapter consults another bundled copy of the context module. The application has an active run in one instance; the adapter sees none in the other.

    A dependency tree can look deduplicated while the build output still contains duplicated runtime state. Listing installed versions is useful, but it does not prove that both imports share the same live context.

    Another boundary is object behavior. SDK clients can expose prototype methods, getters, and methods that depend on the original receiver. A wrapper that merely spreads an instance into a new object may lose functionality. A proxy that forwards a method with the wrong receiver can also break private state access.

    These are integration properties. Test them at the consumer boundary.

    A source test and a published-package consumer exercise different boundaries; the consumer test compares real server calls with persisted spans.

    The server's execution counter is independent of the tracing adapter.

    Use the real SDK without requiring a remote service

    The companion examples install exact versions through a committed lockfile. They create a real MCP Client and Server connected with InMemoryTransport.createLinkedPair().

    The transport is in-memory; the SDK classes are not mocks. The server exposes one synthetic echo tool and increments a counter whenever its tool handler runs.

    The central consumer assertions are:

    const wrapped = wrapMcpClient(client, { serverName: "fixture" });
    
    assert.ok(wrapped instanceof Client);
    await wrapped.ping();
    
    await inspectRun("sdk-capture", async () => {
      await wrapped.listTools();
      const result = await wrapped.callTool({
        name: "echo",
        arguments: {},
      });
      assert.equal(result.content[0].text, "fixture-ok");
    }, { traceDir, silent: true });
    

    This is an excerpt; sdk-smoke-shared.cjs contains the server setup, trace readback, and finally cleanup. The complete harness then asserts:

    assert.equal(calls, 1);
    assert.equal(starts.length, 2);
    assert.ok(starts.some(row => row.name === "mcp:tools/list"));
    assert.ok(starts.some(row => row.name === "mcp:echo"));
    

    Two captured steps are expected because the fixture lists tools and calls one tool. The independent handler count confirms one actual tool execution.

    Without that comparison, “the trace contains one span” could pass while another executed call disappeared.

    Exercise both module systems explicitly

    The test launches two separate consumers: one using ESM imports and another using CommonJS require. Each uses the public package entry points.

    On the Linux environment used for the original article test, Node 24.22.1, both passed:

    ConsumerServer tool callsCaptured list/call stepsSDK ping
    ESM12Pass
    CommonJS12Pass

    During final editorial verification, I installed the same lockfile and reran the complete nine-test harness on macOS arm64 with Node 22.22.3. The ESM and CommonJS SDK consumers passed there as well, with the same one-call/two-captured-step result. That adds a second bounded environment; it does not turn two passing environments into a universal compatibility claim.

    The test also checks the original result and closes the wrapped client and server. It does not establish that every SDK method, transport, authentication path, or operating system is compatible. Native Windows, HTTP and stdio transports, OAuth, reconnect behavior, and the full SDK surface remain outside this fixture.

    That last sentence is part of the result, not a disclaimer to hide below it.

    Use Docker to bound the reproduction

    The examples include a small Dockerfile:

    FROM node:24-bookworm-slim
    WORKDIR /work
    COPY package.json package-lock.json ./
    RUN npm ci --ignore-scripts --no-audit --no-fund
    COPY *.mjs *.cjs ./
    CMD ["npm", "test"]
    

    Build while dependency downloads are available, then run the synthetic suite without external networking:

    docker build -t agent-evidence-probes ./examples
    docker run --rm --network none agent-evidence-probes
    

    Docker's none network driver leaves only loopback networking. That is useful here because the SDK transport is in-memory and the tests need no provider credentials. A blocked network makes accidental external dependencies easier to detect.

    The Node tests were executed for this article; the Docker commands were reviewed but not executed because this environment had no Docker engine. Before publishing a container-specific result, run them yourself. For repeatable CI, record an approved immutable image digest; a major-version tag can move.

    Make the release matrix reflect real support claims

    Linux-in-Docker is not a substitute for native operating-system testing. The added macOS rerun improves the matrix, but it does not cover native Windows. Nor do two passing Node environments validate every version in a peer-dependency range.

    Add cells based on the support policy: module system, operating system, Node version, SDK version, and relevant transport. Keep unsupported or untested cells visible rather than coloring an entire platform green from one smoke test.

    A published contributor report can extend the evidence, but label its exact environment and release. Don’t silently combine different versions into one universal compatibility claim.

    Let external reproductions improve the test boundary

    The useful lesson from a third-party integration report is often not just the bug. It is the missing test shape: public imports, real SDK objects, independently counted calls, and persisted evidence inspected after execution.

    Keep that shape in the release process. A clean monorepo suite is valuable, but the user installs a package, not your test workspace.

    Implementation references

    • Repository's packed MCP SDK evidence script
    • MCP client wrapper
    • Companion: examples/sdk-smoke.mjs, sdk-smoke.cjs, sdk-smoke-shared.cjs, and Dockerfile.

    Tags

    typescripttestingdockeropensource

    Comments

    More Blog

    View all
    Home Office Nightmarediscuss

    Home Office Nightmare

    I Constantly Try to Survive Reality Maybe that's why I built an entire universe, including a...

    P
    Peter Vivo
    Prompt Pad: The Brain and the Workshop Behind Your AI Agentai

    Prompt Pad: The Brain and the Workshop Behind Your AI Agent

    When you build an AI agent, you're actually using two separate things, not one. In this episode of...

    M
    MLH Team
    2
    Why millions of agents don't need millions of VMs on Agent Substrateagents

    Why millions of agents don't need millions of VMs on Agent Substrate

    How stateful agent harnesses run, suspend, and wake in under a second on Agent Substrate 1.0, from one VM to millions of actors.

    E
    Elia Secchi
    Top 7 Featured DEV Posts of the Weektop7

    Top 7 Featured DEV Posts of the Week

    Welcome to this week's Top 7, where the DEV editorial team handpicks their favorite posts from the...

    J
    Jem
    1
    Meme Mondaydiscuss

    Meme Monday

    Meme Monday! Today's cover image comes from the last thread. DEV is an inclusive space! Humor in...

    B
    Ben Halpern
    2
    Stop Using One Prompt for Every Photo! Local Image Classification Before Calling Firebase AI Logic GenerativeModelangular

    Stop Using One Prompt for Every Photo! Local Image Classification Before Calling Firebase AI Logic GenerativeModel

    I upload images of places, wrestlers, and general objects to the application. When uploading images...

    C
    Connie Leung

    Neura weekly digest

    Stay up to date

    The week's most-read AI news, trending AI tools and new automation workflows, in one email. At most once a week. Free, and you can unsubscribe in one click.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for CoPilot and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Games
    • Blog
    • Videos
    • Guides
    • Courses
    • Community
    • Plugins

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this CoPilot resource

    • Extract Internal Links from a Webpagen8n · $9.99 · Related topic
    • Automate Internal Helpdesk Responses in Slack with AI and Email Escalationn8n · $14.99 · Related topic
    • Automate Internal Phishing Simulations with OpenAI and Google Sheetsn8n · $9.99 · Related topic
    Browse all workflows