| load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") |
| load("@build_bazel_rules_nodejs//:internal/common/typescript_mock_lib.bzl", "mock_typescript_lib") |
| |
| # Make the jasmine library available at runtime by exposing our node_modules |
| # directory. |
| filegroup( |
| name = "node_modules", |
| srcs = glob([ |
| "node_modules/**/*.js", |
| "node_modules/**/*.d.ts", |
| "node_modules/**/*.json", |
| ]), |
| visibility = ["//visibility:public"], |
| ) |
| |
| mock_typescript_lib( |
| name = "mock_ts_lib", |
| srcs = ["decrement.js"], |
| ) |
| |
| # This is like a "js_library", but there are no actions to run on JS files so a |
| # filegroup is semantically equivalent. |
| filegroup( |
| name = "program", |
| srcs = ["index.js"], |
| ) |
| |
| jasmine_node_test( |
| name = "test", |
| srcs = glob(["*.spec.js"]), |
| node_modules = "//:node_modules", |
| deps = [ |
| ":mock_ts_lib", |
| ":program", |
| ], |
| ) |