-
Notifications
You must be signed in to change notification settings - Fork 522
/
BUILD.bazel
110 lines (101 loc) · 2.29 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("@npm//@bazel/concatjs:index.bzl", "karma_web_test_suite")
load("@npm//@bazel/typescript:index.bzl", "ts_project")
ts_project(
name = "compile",
srcs = ["decrement.ts"],
extends = "tsconfig.json",
tsconfig = {
"compilerOptions": {
"declaration": True,
},
},
)
js_library(
name = "lib",
package_name = "decrement-lib",
named_module_srcs = [":compile"],
deps = [":compile"],
)
ts_project(
name = "compile_tests",
testonly = 1,
srcs = glob(["*.spec.ts"]),
extends = "tsconfig.json",
tsconfig = {
"compilerOptions": {
"types": [
"jasmine",
"node",
],
},
},
deps = [
":lib",
"@npm//@types/jasmine",
"@npm//@types/node",
],
)
js_library(
name = "tests",
testonly = 1,
named_module_srcs = [":compile_tests"],
deps = ["lib"],
)
ts_project(
name = "compile_tests_setup",
testonly = 1,
srcs = ["setup_script.ts"],
extends = "tsconfig.json",
tsconfig = {},
deps = [
"@npm//@types/jasmine",
"@npm//@types/node",
],
)
js_library(
name = "tests_setup",
testonly = 1,
named_module_srcs = [":compile_tests_setup"],
)
karma_web_test_suite(
name = "config_test",
browsers = [
"@io_bazel_rules_webtesting//browsers:chromium-local",
"@io_bazel_rules_webtesting//browsers:firefox-local",
],
config_file = ":karma.conf.js",
static_files = [
"static_script.js",
],
tags = ["native"],
runtime_deps = [
":tests_setup",
],
deps = [
":tests",
"@npm//karma-json-result-reporter",
],
)
karma_web_test_suite(
name = "no_config_test",
browsers = [
"@io_bazel_rules_webtesting//browsers:chromium-local",
"@io_bazel_rules_webtesting//browsers:firefox-local",
],
static_files = [
"static_script.js",
],
tags = ["native"],
runtime_deps = [
":tests_setup",
],
deps = [
":tests",
],
)
# Just a dummy test so that we have a test target for //... on certain bazelci platforms with bazel_integration_test
sh_test(
name = "dummy_test",
srcs = ["dummy_test.sh"],
)