@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:
testMatchkeeps eval suites separate from regular tests.reporterskeeps Jest’s default reporter and adds the Phoenix summary block at the end of the run.setupFiles: ["dotenv/config"]loadsPHOENIX_ENDPOINT,PHOENIX_API_KEY, and other env vars from.env.testTimeoutis 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:
API#
The exported names match the Vitest entrypoint exactly:
describe,describe.only,describe.skiptest,test.only,test.skip,test.eachit(alias fortest)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
globalThisat suite-declaration time, so importing it outside of a Jest test run will throw with a helpful error message. - Jest’s
--bailflag will short-circuit the experiment; the Phoenix reporter still prints a summary for the suites that ran.
Source Map
src/jest/index.tssrc/jest/reporter.tssrc/testing/runner.ts

