Jasmine rules for Bazel
The Jasmine rules run tests under the Jasmine framework with Bazel.
Installation
Add the @bazel/jasmine
npm package to your devDependencies
in package.json
.
jasmine_node_test
Runs tests in NodeJS using the Jasmine test runner.
Detailed XML test results are found in the standard bazel-testlogs
directory. This may be symlinked in your workspace.
See https://docs.bazel.build/versions/master/output_directories.html
To debug the test, see debugging notes in nodejs_test
.
jasmine_node_test(name, srcs, data, deps, expected_exit_code, tags, config_file, jasmine,
jasmine_entry_point, kwargs)
PARAMETERS
Name | Description | Default |
---|
name |
Name of the resulting label
|
</td>
</tr>
<tr id="jasmine_node_test-srcs">
<td>srcs</td>
<td>
JavaScript source files containing Jasmine specs
</td>
<td>
[]
</td>
</tr>
<tr id="jasmine_node_test-data">
<td>data</td>
<td>
Runtime dependencies which will be loaded while the test executes
</td>
<td>
[]
</td>
</tr>
<tr id="jasmine_node_test-deps">
<td>deps</td>
<td>
Other targets which produce JavaScript, such as ts_library
</td>
<td>
[]
</td>
</tr>
<tr id="jasmine_node_test-expected_exit_code">
<td>expected_exit_code</td>
<td>
The expected exit code for the test.
</td>
<td>
0
</td>
</tr>
<tr id="jasmine_node_test-tags">
<td>tags</td>
<td>
Bazel tags applied to test
</td>
<td>
[]
</td>
</tr>
<tr id="jasmine_node_test-config_file">
<td>config_file</td>
<td>
(experimental) label of a file containing Jasmine JSON config.
Note that not all configuration options are honored, and
we expect some strange feature interations.
For example, the filter for which files are instrumented for
code coverage doesn't understand the spec_files setting in the config.
See https://jasmine.github.io/setup/nodejs.html#configuration
|
None
|
jasmine |
A label providing the @bazel/jasmine npm dependency.
|
"//@bazel/jasmine"
|
jasmine_entry_point |
A label providing the @bazel/jasmine entry point.
|
"//:node_modules/@bazel/jasmine/jasmine_runner.js"
|
kwargs |
Remaining arguments are passed to the test rule
|
</td>
</tr>
</tbody>
|