sourcegraph/client/template-parser/BUILD.bazel
Quinn Slack 4002774429
reapply "switch from jest to vitest for faster, simpler tests (#57886)" (#58145)
* reapply "switch from jest to vitest for faster, simpler tests (https://github.com/sourcegraph/sourcegraph/pull/57886)"

This was reverted in https://github.com/sourcegraph/sourcegraph/pull/58116 due to an issue with the browser tests.

* include fetch-mock

* fix flakiness

* rm mock that did not work in experimentalVmThreads

* fix

* timeout

* fixup

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2023-11-07 12:00:18 +02:00

62 lines
1.2 KiB
Python

load("@aspect_rules_ts//ts:defs.bzl", "ts_config")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//dev:defs.bzl", "npm_package", "ts_project", "vitest_test")
load("//dev:eslint.bzl", "eslint_config_and_lint_root")
npm_link_all_packages(name = "node_modules")
eslint_config_and_lint_root()
ts_config(
name = "tsconfig",
src = "tsconfig.json",
visibility = ["//client:__subpackages__"],
deps = [
"//:tsconfig",
],
)
ts_project(
name = "template-parser_lib",
srcs = [
"src/expr/evaluator.ts",
"src/expr/index.ts",
"src/expr/lexer.ts",
"src/expr/parser.ts",
"src/index.ts",
"src/types.ts",
],
tsconfig = ":tsconfig",
)
ts_project(
name = "template-parser_tests",
testonly = True,
srcs = [
"src/expr/evaluator.test.ts",
"src/expr/lexer.test.ts",
"src/expr/parser.test.ts",
],
tsconfig = ":tsconfig",
deps = [
":template-parser_lib",
"//:node_modules/vitest",
],
)
npm_package(
name = "template-parser_pkg",
srcs = [
"package.json",
":template-parser_lib",
],
)
vitest_test(
name = "test",
timeout = "short",
data = [
":template-parser_tests",
],
)