sourcegraph/client/observability-server/BUILD.bazel
Jason Bedard 10aefc4bb7
bazel: add bazel build,tests for client/* (#46193)
Webpack bundles compile but need further testing. Jest + mocha tests
compile but are marked as `manual` until further work is done to get them
passing. The four jest tests are green and enabled now, though.

## Test plan

`bazel build //client/...` and `bazel test //client/...`
2023-02-28 20:46:03 -08:00

64 lines
1.6 KiB
Python

load("@aspect_rules_ts//ts:defs.bzl", "ts_config")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//dev:defs.bzl", "jest_test", "ts_project")
npm_link_all_packages(name = "node_modules")
ts_config(
name = "tsconfig",
src = "tsconfig.json",
visibility = ["//client:__subpackages__"],
deps = [
"//:tsconfig",
"//client/build-config:tsconfig",
],
)
ts_project(
name = "observability-server",
srcs = [
"src/constants.ts",
"src/honeycomb/clone-boards.ts",
"src/libhoney.d.ts",
"src/sdk.ts",
"src/webBundleSize/getBundleSizeStats.ts",
"src/webBundleSize/index.ts",
],
tsconfig = ":tsconfig",
deps = [
":node_modules/@sourcegraph/build-config",
"//:node_modules/@opentelemetry/semantic-conventions",
"//:node_modules/@types/glob",
"//:node_modules/@types/lodash",
"//:node_modules/@types/node",
"//:node_modules/@types/node-fetch",
"//:node_modules/@types/signale",
"//:node_modules/envalid",
"//:node_modules/glob",
"//:node_modules/libhoney",
"//:node_modules/lodash",
"//:node_modules/node-fetch",
"//:node_modules/signale",
],
)
ts_project(
name = "observability-server_tests",
testonly = True,
srcs = ["src/webBundleSize/getBundleSizeStats.test.ts"],
tsconfig = ":tsconfig",
deps = [
":observability-server",
"//:node_modules/@types/node",
],
)
jest_test(
name = "test",
data = [
":observability-server_tests",
],
# TODO(bazel): requires webpack setup for testing
tags = ["manual"],
)