11load ("@devinfra_npm//:defs.bzl" , "npm_link_all_packages" )
2- load ("//tools:defaults.bzl" , "esbuild_checked_in" , "ts_project" )
2+ load ("//tools:defaults.bzl" , "esbuild_checked_in" , "jasmine_test" , " ts_project" )
33
44package (default_visibility = ["//github-actions/labeling/pull-request:__subpackages__" ])
55
66npm_link_all_packages ()
77
88ts_project (
99 name = "lib" ,
10- srcs = glob (["lib/*.ts" ]),
10+ srcs = glob (
11+ ["lib/*.ts" ],
12+ exclude = ["lib/*.spec.ts" ],
13+ ),
1114 tsconfig = "//github-actions:tsconfig" ,
1215 deps = [
1316 ":node_modules/@actions/core" ,
@@ -24,6 +27,26 @@ ts_project(
2427 ],
2528)
2629
30+ ts_project (
31+ name = "test_lib" ,
32+ testonly = True ,
33+ srcs = glob ([
34+ "lib/*.spec.ts" ,
35+ ]),
36+ tsconfig = "//github-actions:tsconfig_test" ,
37+ visibility = [
38+ "//github-actions/labeling/pull-request:__subpackages__" ,
39+ ],
40+ deps = [
41+ "//github-actions:node_modules/@types/jasmine" ,
42+ "//github-actions:node_modules/@types/node" ,
43+ "//github-actions/labeling/pull-request:lib" ,
44+ "//github-actions/labeling/pull-request:node_modules/@actions/core" ,
45+ "//github-actions/labeling/pull-request:node_modules/@actions/github" ,
46+ "//github-actions/labeling/pull-request:node_modules/@octokit/rest" ,
47+ ],
48+ )
49+
2750esbuild_checked_in (
2851 name = "main" ,
2952 srcs = [
@@ -34,3 +57,10 @@ esbuild_checked_in(
3457 platform = "node" ,
3558 target = "node22" ,
3659)
60+
61+ jasmine_test (
62+ name = "test" ,
63+ data = [
64+ ":test_lib" ,
65+ ],
66+ )
0 commit comments