mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:51:50 +00:00
* 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>
62 lines
1.2 KiB
Python
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",
|
|
],
|
|
)
|