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:

  • 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_ENDPOINT, PHOENIX_API_KEY, and other env vars from .env.
  • testTimeout is bumped because LLM calls can be slow.
Note

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:

API#

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.