Refactor integration tests to not use shared user config

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.8.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Not Needed
    • APIx DevTools

      Summary
      Improve the integration tests by replacing the current "snapshot and restore" workaround for userConfig with formal dependency injection.

      Current Situation
      In createDeployment.test.ts, the test for voyageApiKey currently relies on mutating the global userConfig. Because describeWithAtlasLocal doesn't natively support config injection, we are using a beforeEach/afterEach to snapshot and restore the userConfig state. This prevents this specific test from unintentionally affecting other tests in the future.

      Goal

      • Support explicit dependency injection for userConfig.
      • Allow mock configurations to be passed directly into the mock server.
      • Remove the need for manual state management (snapshot/restore) in individual test files.

      Context

      https://github.com/mongodb-js/mongodb-mcp-server/pull/912/changes/BASE..832181a48fbdf1d0c00306b715813b5c7f3144f2#r2833355660 

            Assignee:
            Luke Sanderson
            Reporter:
            Luke Sanderson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: