| load("@npm//http-server:index.bzl", "http_server") |
| load("@npm//mocha:index.bzl", "mocha_test") |
| load("@npm_bazel_protractor//:index.bzl", "protractor_web_test_suite") |
| load(":differential_loading.bzl", "differential_loading") |
| |
| differential_loading( |
| name = "app", |
| srcs = glob(["*.ts"]), |
| entry_point = "index.ts", |
| ) |
| |
| http_server( |
| name = "server", |
| data = [":app"], |
| templated_args = ["app"], |
| ) |
| |
| # BazelCI docker images are missing shares libs to run a subset browser tests: |
| # mac: firefox does not work, chrome works |
| # ubuntu: firefox and chrome do not work --- there are 0 tests to run |
| # windows: firefox works, chrome does not work |
| # TODO(gregmagolan): support firefox in protractor rule |
| protractor_web_test_suite( |
| name = "server_test", |
| srcs = ["app.spec.js"], |
| on_prepare = ":protractor.on-prepare.js", |
| server = ":server", |
| tags = [ |
| "no-bazelci-ubuntu", |
| "no-bazelci-windows", |
| ], |
| ) |
| |
| mocha_test( |
| name = "test_sourcemaps", |
| # if we were in a subdirectory we'd need |
| # package_name() + "/*.spec.js" |
| args = ["*.spec.js"], |
| data = [ |
| "sourcemaps.spec.js", |
| ":app_chunks", |
| ":app_chunks.min", |
| ":app_chunks_es5", |
| ":app_chunks_es5.min", |
| "@npm//source-map", |
| ], |
| tags = [ |
| # Need to set the pwd to avoid mocha needing a runfiles helper |
| "no-bazelci-windows", |
| ], |
| ) |
| |
| # 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"], |
| ) |