a2d3958e1f
Run the tests in headless mode and output the logs bazel test :hello_world --test_output=all Start up a visible web browser with the karma test driver (need to go to Debug tab to actually run tests) bazel run :hello_world Suggested review order - package.json to see the karma dependencies to run jasmine tests on chrome and firefox. - WORKSPACE.bazel to see how the packages listed in package.json and package-lock.json are downloaded into the Bazel sandbox/cache via the npm_install rule. As mentioned in the package.json comment, the version of build_bazel_rules_nodejs which emscripten uses [1] is 4.4.1 and if we tried to install it ourselves, that installation will be ignored. We also bring in hermetic browsers via io_bazel_rules_webtesting. - bazel/karma_test.bzl which defines a new rule _karma_test and a macro karma_test which joins the new rule with an existing web_test rule to run it on a hermetic browser which Bazel downloads. This rule takes heavy inspiration from @bazel/concatjs [2], but is much simpler and lets us configure more things (e.g. proxies, so we can work with test_on_env). - karma.bazel.js, which is a pretty ordinary looking karma configuration file [2] with effectively a JS macro BAZEL_APPLY_SETTINGS. JS doesn't have a preprocessor or actual macros, but this string will be replaced by the JS code in karma_test.bzl which will set correct filepaths for Bazel content. - All other files. [1] |
||
---|---|---|
.. | ||
gcs_mirror.go |