@apollo/server-integration-testsuite

中文文档
5.5.1发布于 2026/05/06MITTypeScriptESM + CJS构建来源已验证近 30 天下载 1.6万

Test suite for Apollo Server integrations

原始使用文档

Apollo Server Integration Testsuite

This package serves as a set of Jest tests for Apollo Server integration authors. Any Node package which functions as the HTTP (or HTTP framework) binding and Apollo Server can run these tests to ensure parity with built-in "standalone" implementation.

Note: this package is only intended for integration authors. If your project runs an Apollo Server instance, you probably shouldn't use this.

The version of this package will be published in lockstep with Apollo Server, so choose the same version of this package as the version of Apollo Server which you intend to support. The expected configuration for an integration should follow the pattern:

{
  "name": "my-server-integration",
  "devDependencies": {
    "@apollo/server": "5.0.0",
    "@apollo/server-integration-testsuite": "5.0.0"
  },
  "peerDependencies": {
    "@apollo/server": "^4.0.0 || ^5.0.0"
  }
}

In the example above, the peerDependencies allow your configuration to be used with the full range of Apollo Server v4 - v5 packages. The devDependencies which your integration is built and tested against should stay up-to-date with the latest version of Apollo Server, and the server and testsuite packages should be in lockstep with each other.

This package imposes dependency requirements on your project, however it should only require they be installed as devDependencies:

  • @apollo/server's version must match the version of the test suite.
  • The test suite expects you to be running jest@29. It's possible that other versions of Jest may be compatible, but this use case is unsupported and might lead to unexpected behavior. It's fine for your project to use a testing framework other than Jest, but you'll still need to configure Jest in your project in order to run the test suite (so you'll have two test runners configured in your project). Because of this, we recommend using only Jest in your project for simplicity.
  • graphql must be installed in your project in peerDependencies and your version range should match that of @apollo/server. The test suite package's graphql dependency will match that of Apollo Server's.

版本与发布记录

@apollo/server-integration-testsuite 共发布 76 个版本,首次发布于 2022/07/14;过去 12 个月发布了 6 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
5.5.1latest2026/05/066 个月前
5.5.02026/03/257 个月前
5.4.02026/02/049 个月前
4.13.02026/02/049 个月前
5.3.02026/01/219 个月前
5.2.02025/11/2211 个月前

其他发布通道:alpha → 4.12.2-alpha.0,rc → 5.1.0-rc.0。

关于 @apollo/server-integration-testsuite 的常见问题

@apollo/server-integration-testsuite 是什么?

Test suite for Apollo Server integrations

如何安装 @apollo/server-integration-testsuite?

在项目目录运行 npm install @apollo/server-integration-testsuite,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@jest/globals(29.x || 30.x)、graphql(^16.11.0)、jest(29.x || 30.x)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@apollo/server-integration-testsuite 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@apollo/server-integration-testsuite 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@apollo/server-integration-testsuite 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@apollo/server-integration-testsuite 可以商用吗?

@apollo/server-integration-testsuite 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@apollo/server-integration-testsuite 的下载量有多少?

根据 npm 官方下载统计,@apollo/server-integration-testsuite 在 2026/10/07 – 2026/11/05 这 30 天内被下载 15,743 次,日均约 525 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@apollo/server-integration-testsuite 还在维护吗?

最新版本 5.5.1 发布于 2026/05/06(6 个月前);至今共发布 76 个版本,其中过去 12 个月发布了 6 个;首次发布于 2022/07/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。