File
Blob: build/wd_ts_test.bzl
| 1 | load("@aspect_rules_js//js:defs.bzl", "js_test") |
| 2 | load("//:build/typescript.bzl", "js_name", "module_name") |
| 3 | load("//:build/wd_ts_project.bzl", "wd_ts_project") |
| 4 | |
| 5 | def wd_ts_test(src, tsconfig_json, deps = [], eslintrc_json = None, composite = False, **kwargs): |
| 6 | """Bazel rule to compile and run a TypeScript test""" |
| 7 | |
| 8 | name = module_name(src) |
| 9 | |
| 10 | wd_ts_project( |
| 11 | name = name + "@compile", |
| 12 | srcs = [src], |
| 13 | deps = deps, |
| 14 | testonly = True, |
| 15 | eslintrc_json = eslintrc_json, |
| 16 | tsconfig_json = tsconfig_json, |
| 17 | composite = composite, |
| 18 | ) |
| 19 | |
| 20 | js_test( |
| 21 | name = name, |
| 22 | entry_point = js_name(src), |
| 23 | data = deps + [name + "@compile"], |
| 24 | tags = ["no-arm64", "js-test"], |
| 25 | **kwargs |
| 26 | ) |