| load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle") |
| |
| # TODO(alexeagle): promote web_package rule to the public API |
| load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package") |
| load("@npm_bazel_protractor//:index.bzl", "protractor_web_test_suite") |
| |
| rollup_bundle( |
| name = "bundle", |
| srcs = glob(["*.js"]), |
| entry_point = ":index.js", |
| ) |
| |
| web_package( |
| name = "package", |
| assets = [ |
| # For differential loading, we supply both an ESModule entry point and an es5 entry point |
| # The injector will put two complimentary script tags in the index.html |
| ":bundle.min.js", |
| ":bundle.min.es2015.js", |
| "styles.css", |
| ], |
| data = [ |
| "favicon.png", |
| ":bundle", |
| ], |
| index_html = "index.html", |
| ) |
| |
| http_server( |
| name = "server", |
| data = [":package"], |
| templated_args = ["package"], |
| ) |
| |
| # 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", |
| ], |
| ) |
| |
| # 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"], |
| ) |
| |
| # For testing from the root workspace of this repository with bazel_integration_test. |
| filegroup( |
| name = "all_files", |
| srcs = glob( |
| include = ["**/*"], |
| exclude = [ |
| "bazel-out/**/*", |
| "dist/**/*", |
| "node_modules/**/*", |
| ], |
| ), |
| visibility = ["//visibility:public"], |
| ) |