2021-03-25 00:43:01 +01:00
|
|
|
load("@npm//@bazel/typescript:index.bzl", "ts_library")
|
2021-03-28 11:39:11 +02:00
|
|
|
load("@npm//jest-cli:index.bzl", "jest_test")
|
2021-03-25 00:43:01 +01:00
|
|
|
load("//ts:prettier.bzl", "prettier_test")
|
|
|
|
load("//ts:eslint.bzl", "eslint_test")
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "html-filter",
|
2021-03-28 11:39:11 +02:00
|
|
|
srcs = glob(
|
|
|
|
["*.ts"],
|
|
|
|
exclude = ["*.test.ts"],
|
|
|
|
),
|
2021-03-25 00:43:01 +01:00
|
|
|
module_name = "html-filter",
|
2021-03-26 04:58:03 +01:00
|
|
|
tsconfig = "//ts:tsconfig.json",
|
2021-03-25 00:43:01 +01:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [],
|
|
|
|
)
|
|
|
|
|
2021-03-28 11:39:11 +02:00
|
|
|
ts_library(
|
|
|
|
name = "test_lib",
|
|
|
|
srcs = glob(["*.test.ts"]),
|
|
|
|
tsconfig = "//ts:tsconfig.json",
|
|
|
|
deps = [
|
|
|
|
"html-filter",
|
|
|
|
"@npm//@types/jest",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
jest_test(
|
|
|
|
name = "test",
|
|
|
|
args = [
|
|
|
|
"--no-cache",
|
|
|
|
"--no-watchman",
|
|
|
|
"--ci",
|
|
|
|
"--colors",
|
|
|
|
"--config",
|
|
|
|
"$(location //ts:jest.config.js)",
|
|
|
|
],
|
|
|
|
data = [
|
|
|
|
":test_lib",
|
|
|
|
"//ts:jest.config.js",
|
|
|
|
"//ts:package.json",
|
|
|
|
],
|
2021-03-28 12:34:10 +02:00
|
|
|
target_compatible_with = select({
|
|
|
|
"@platforms//os:osx": [],
|
|
|
|
"@platforms//os:linux": [],
|
|
|
|
"//conditions:default": ["@platforms//os:linux"],
|
|
|
|
}),
|
2021-03-28 11:39:11 +02:00
|
|
|
)
|
|
|
|
|
2021-03-25 00:43:01 +01:00
|
|
|
# Tests
|
|
|
|
################
|
|
|
|
|
|
|
|
prettier_test(
|
|
|
|
name = "format_check",
|
|
|
|
srcs = glob([
|
|
|
|
"*.ts",
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
|
|
|
|
eslint_test(
|
|
|
|
name = "eslint",
|
|
|
|
srcs = glob(
|
|
|
|
[
|
|
|
|
"*.ts",
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|