Skip to main content
@arizeai/phoenix-client/jest exposes the same API as the Vitest entrypoint but binds to Jest’s globals (describe, test, it, beforeAll, afterAll).

Setup

Create a separate phoenix.jest.config.cjs:
module.exports = {
  testMatch: ["**/*.eval.?(c|m)[jt]s"],
  reporters: ["default", "@arizeai/phoenix-client/jest/reporter"],
  setupFiles: ["dotenv/config"],
  testTimeout: 30000,
};
  • testMatch keeps eval suites separate from regular tests.
  • reporters keeps Jest’s default reporter and adds the Phoenix summary block at the end of the run.
  • setupFiles: ["dotenv/config"] loads PHOENIX_HOST, PHOENIX_API_KEY, and other env vars from .env.
  • testTimeout is bumped because LLM calls can be slow.
The jsdom test environment is not supported. Either omit testEnvironment or set it to "node". For TypeScript or ESM use ts-jest / @swc/jest per Jest’s docs.
Add a script to package.json:
{
  "scripts": {
    "eval": "jest --config phoenix.jest.config.cjs"
  }
}

API

import * as px from "@arizeai/phoenix-client/jest";
The exported names match the Vitest entrypoint exactly:
  • describe, describe.only, describe.skip
  • test, test.only, test.skip, test.each
  • it (alias for test)
  • logOutput, logAnnotation, evaluate
See CI Eval Tests: Vitest for the full API reference — the surface is identical. The only difference is the import path and the underlying runner.

Notes

  • This module reads Jest globals off globalThis at suite-declaration time, so importing it outside of a Jest test run will throw with a helpful error message.
  • Jest’s --bail flag will short-circuit the experiment; the Phoenix reporter still prints a summary for the suites that ran.

Source Map

  • src/jest/index.ts
  • src/jest/reporter.ts
  • src/testing/runner.ts