sourcegraph/client/http-client
Quinn Slack ae5325e432
switch from jest to vitest for faster, simpler tests (#57886)
Replaces our usage of jest with vitest. Also removes the babel transpiler. This simplifies our test configuration by a lot, makes tests run 10% faster, and makes further modernizations to our build/test stuff possible (such as using vite for frontend builds).

This removes some of the junit exporting for Buildkite, and the vitest bazel defs don't really cleanly implement bazel testing guidelines (like sharding). But vitest is only used for unit tests (all integration/e2e/regression tests have always run in mocha), so none of them are very slow anyway.

## Codemods for vitest imports

fastmod -e js,ts,tsx @jest/globals vitest client/ dev/release/
fastmod -e js,ts,tsx 'jest\.(\w+)\(' 'vi.$1(' client/ dev/release/
fastmod -e js,ts,tsx 'jest,' 'vi,' client/ dev/release/
fastmod -e js,ts,tsx 'jest }' 'vi }' client/ dev/release/
git diff --diff-filter=M --name-only | xargs pnpm exec prettier --write
2023-11-05 21:57:04 -10:00
..
src switch from jest to vitest for faster, simpler tests (#57886) 2023-11-05 21:57:04 -10:00
.eslintignore [SG-28893] refactor: extract graphql folder into a new http-client package. (#29346) 2022-01-13 18:40:35 +01:00
BUILD.bazel switch from jest to vitest for faster, simpler tests (#57886) 2023-11-05 21:57:04 -10:00
OWNERS Update FPT code owners ping (#44545) 2022-11-17 07:21:49 -05:00
package.json switch from jest to vitest for faster, simpler tests (#57886) 2023-11-05 21:57:04 -10:00
README.md web: deprecate requestGraphQL and update http-client README (#47597) 2023-02-14 18:51:01 -08:00
tsconfig.json simplify tsconfig.json files (#57913) 2023-10-26 03:03:11 -07:00
vitest.config.ts switch from jest to vitest for faster, simpler tests (#57886) 2023-11-05 21:57:04 -10:00

Http Client

Generic logic for sending and handling HTTP requests from our client applications.

Use the getGraphQLClient client utility to create an app-specific instance of the Apollo Client, which is the recommended way to interact with Sourcegraph API from web applications.