|
1 | 1 | load("@npm//@angular/build-tooling/bazel/spec-bundling:index.bzl", "spec_bundle")
|
2 | 2 | load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
|
3 |
| -load("//tools:defaults.bzl", "ts_library") |
| 3 | +load("//tools:interop.bzl", "ts_project") |
4 | 4 |
|
5 |
| -ESM_TESTS = [ |
6 |
| - "app_spec.ts", |
7 |
| - "app-engine_spec.ts", |
8 |
| - "routes/router_spec.ts", |
9 |
| - "routes/route-tree_spec.ts", |
10 |
| - "routes/ng-routes_spec.ts", |
11 |
| -] |
12 |
| - |
13 |
| -ts_library( |
| 5 | +ts_project( |
14 | 6 | name = "unit_test_lib",
|
15 | 7 | testonly = True,
|
16 | 8 | srcs = glob(
|
17 |
| - include = ["**/*_spec.ts"], |
18 |
| - exclude = ESM_TESTS + ["npm_package/**"], |
| 9 | + include = ["**/*.ts"], |
19 | 10 | ),
|
20 | 11 | deps = [
|
21 |
| - "//packages/angular/ssr", |
22 |
| - ], |
23 |
| -) |
24 |
| - |
25 |
| -ts_library( |
26 |
| - name = "unit_test_with_esm_deps_lib", |
27 |
| - testonly = True, |
28 |
| - srcs = ESM_TESTS + ["testing-utils.ts"], |
29 |
| - deps = [ |
30 |
| - "//packages/angular/ssr", |
31 |
| - "@npm//@angular/common", |
32 |
| - "@npm//@angular/compiler", |
33 |
| - "@npm//@angular/core", |
34 |
| - "@npm//@angular/platform-browser", |
35 |
| - "@npm//@angular/platform-server", |
36 |
| - "@npm//@angular/router", |
| 12 | + "//:root_modules/@angular/common", |
| 13 | + "//:root_modules/@angular/compiler", |
| 14 | + "//:root_modules/@angular/core", |
| 15 | + "//:root_modules/@angular/platform-browser", |
| 16 | + "//:root_modules/@angular/platform-server", |
| 17 | + "//:root_modules/@angular/router", |
| 18 | + "//packages/angular/ssr:ssr_rjs", |
37 | 19 | ],
|
38 | 20 | )
|
39 | 21 |
|
40 | 22 | spec_bundle(
|
41 |
| - name = "unit_test_with_esm_deps_lib_bundled", |
| 23 | + name = "esm_tests_bundled", |
42 | 24 | downlevel_async_await = False,
|
43 | 25 | platform = "node",
|
44 | 26 | run_angular_linker = False,
|
45 | 27 | deps = [
|
46 |
| - ":unit_test_with_esm_deps_lib", |
| 28 | + ":unit_test_lib", |
47 | 29 | ],
|
48 | 30 | )
|
49 | 31 |
|
50 | 32 | jasmine_node_test(
|
51 | 33 | name = "test",
|
52 |
| - deps = [ |
53 |
| - ":unit_test_lib", |
54 |
| - ":unit_test_with_esm_deps_lib_bundled", |
55 |
| - ], |
| 34 | + deps = [":esm_tests_bundled"], |
56 | 35 | )
|
0 commit comments