Jasmine rules for Bazel
WARNING: this is beta-quality software. Breaking changes are likely. Not recommended for production use without expert support.
The Jasmine rules run tests under the Jasmine framework with Bazel.
Installation
Add the @bazel/jasmine
npm package to your devDependencies
in package.json
.
Your WORKSPACE
should declare a yarn_install
or npm_install
rule named npm
.
It should then install the rules found in the npm packages using the `install_bazel_dependencies' function.
See https://github.com/bazelbuild/rules_nodejs/#quickstart
This causes the @bazel/jasmine
package to be installed as a Bazel workspace named npm_bazel_jasmine
.
NodeJS testing
Macros
Overview
These rules let you run tests outside of a browser. This is typically faster
than launching a test in Karma, for example.
jasmine_node_test
jasmine_node_test(name, srcs, data, deps, expected_exit_code, tags, jasmine, **kwargs)
Runs tests in NodeJS using the Jasmine test runner.
To debug the test, see debugging notes in nodejs_test
.
Attributes
name |
Name; Required
name of the resulting label
|
srcs |
List of strings; Optional
JavaScript source files containing Jasmine specs
|
data |
List of strings; Optional
Runtime dependencies which will be loaded while the test executes
|
deps |
List of strings; Optional
Other targets which produce JavaScript, such as ts_library
|
expected_exit_code |
Integer; Optional
The expected exit code for the test. Defaults to 0.
|
tags |
List of strings; Optional
bazel tags applied to test
|
jasmine |
String; Optional
a label providing the jasmine dependency
|
**kwargs |
Unknown; Optional
remaining arguments are passed to the test rule
|