Public API surface is re-exported here.
Macros and Functions
Runs unit tests in a browser with Karma.
When executed under
bazel test, this uses a headless browser for speed.
This is also because
bazel test allows multiple targets to be tested together,
and we don't want to open a Chrome window on your machine for each one. Also,
bazel test the test will execute and immediately terminate.
ibazel test gives you a "watch mode" for your tests. The rule is
optimized for this case - the test runner server will stay running and just
To debug a single test target, run it with
bazel run instead. This will open a
browser window on your computer. Also you can use any other browser by opening
the URL printed when the test starts up. The test will remain running until you
bazel run command.
This rule will use your system Chrome by default. In the default case, your
environment must specify CHROME_BIN so that the rule will know which Chrome binary to run.
customLaunchers may be set using the a base Karma configuration
specified in the
By default we open a headless Chrome. To use a real Chrome browser window, you can pass
--define DISPLAY=true to Bazel, along with
configuration_env_vars = ["DISPLAY"] on
Pass these configuration environment variables to the resulting binary. Chooses a subset of the configuration environment variables (taken from ctx.var), which also includes anything specified via the --define flag. Note, this can lead to different outputs produced by this rule.
Dependencies which should be loaded after the module loader but before the srcs and deps.
The files will be loaded in the same order they are declared by that rule.
Arbitrary files which are available to be served on request.
Files are served at:
User supplied Karma configuration file. Bazel will override certain attributes of this configuration file. Attributes that are overridden will be outputted to the test log.
Standard Bazel tags, this macro adds tags for ibazel support
list of peer npm deps required by karma_web_test
Passed through to
Defines a test_suite of web_test targets that wrap a karma_web_test target.
This macro accepts all parameters in karma_web_test and adds additional parameters for the suite. See karma_web_test docs for all karma_web_test.
The wrapping macro is
web_test_suite which comes from rules_websting:
The base name of the test
A sequence of labels specifying the browsers to use.
Data dependencies for the wrapper web_test targets.
A list of test tag strings to use for the wrapped karma_web_test target.
Arguments for the wrapped karma_web_test target.