@aspect_rules_jasmine//jasmine:defs.bzl
rules_jasmine public API
Functions & Macros
jasmine_testRuns jasmine under bazel test
Parameters
*name | A unique name for this target. |
*node_modules | Label pointing to the linked node_modules target where jasmine is linked, e.g.
|
jasmine_reporters | Whether When enabled, adds a custom reporter to output junit XML to the path where Bazel expects to find it. Default: True |
config | jasmine config file. See: https://jasmine.github.io/setup/nodejs.html#configuration Default: None |
timeout | standard attribute for tests. Defaults to "short" if both timeout and size are unspecified. Default: None |
size | standard attribute for tests Default: None |
data | Runtime dependencies that Jasmine should be able to read. This should include all test files, configuration files & files under test. Default: [] |
kwargs | Additional named parameters from |
Rules
jasmine_test_ruleRuns tests in NodeJS using the Jasmine test runner.
| Attribute | Type | Description |
|---|---|---|
*name | name | A unique name for this target. |
chdir | string | Working directory to run the binary or test in, relative to the workspace. By default, To run in the directory containing the
(or if you're in a macro, use WARNING: this will affect other paths passed to the program, either as arguments or in configuration files, You may need
Default: "" |
data | list of labels | Runtime dependencies of the program. The transitive closure of the NB: Default: [] |
*entry_point | label | The main script which is evaluated by node.js. This is the module referenced by the This must be a target that provides a single file or a See https://github.com/aspect-build/bazel-lib/blob/main/docs/directory_path.md |
*enable_runfiles | boolean | Whether runfiles are enabled in the current build configuration. Typical usage of this rule is via a macro which automatically sets this |
env | dictionary: String → String | Environment variables of the action. Subject to $(location) Default: {} |
expand_args | boolean | Enables $(location) This comes at some analysis-time cost even for a set of args that does not have any expansions. Default: True |
expand_env | boolean | Enables $(location) This comes at some analysis-time cost even for a set of envs that does not have any expansions. Default: True |
fixed_args | list of strings | Fixed command line arguments to pass to the Node.js when this Subject to $(location) Unlike the built-in
See https://bazel.build/reference/be/common-definitions#common-attributes-binaries Default: [] |
node_options | list of strings | Options to pass to the node invocation on the command line. https://nodejs.org/api/cli.html These options are passed directly to the node invocation on the command line. Default: [] |
expected_exit_code | integer | The expected exit code. Can be used to write tests that are expected to fail. Default: 0 |
log_level | string | Set the logging level. Log from are written to stderr. They will be supressed on success when running as the tool Log levels: fatal, error, warn, info, debug Default: "error" |
patch_node_fs | boolean | Patch the to Node.js When enabled, When disabled, node programs can leave the execroot, runfiles and sandbox by following symlinks Default: True |
include_sources | boolean | When True, Default: True |
include_transitive_sources | boolean | When True, Default: True |
include_types | boolean | When True, Defaults to False since types are generally not needed at runtime and introducing them could slow down developer round trip NB: These are types from direct Default: False |
include_transitive_types | boolean | When True, Defaults to False since types are generally not needed at runtime and introducing them could slow down developer round trip Default: False |
include_npm_sources | boolean | When True, files in
Default: True |
preserve_symlinks_main | boolean | When True, the --preserve-symlinks-main flag is passed to node. This prevents node from following an ESM entry script out of runfiles and the sandbox. This can happen for This flag was added in Node.js v10.2.0 (released 2018-05-23). If your node toolchain is configured to use a See https://nodejs.org/api/cli.html#--preserve-symlinks-main for more information. Default: True |
no_copy_to_bin | list of labels | List of files to not copy to the Bazel output tree when This is useful for exceptional cases where a Default: [] |
copy_data_to_bin | boolean | When True, Defaults to True so that a Setting this to False is more optimal in terms of inputs, but there is a yet unresolved issue of ESM imports Default: True |
include_npm | boolean | When True, npm is included in the runfiles of the target. An npm binary is also added on the PATH so tools can spawn npm processes. This is a bash script A minimum of rules_nodejs version 5.7.0 is required which contains the Node.js toolchain changes Default: False |
node_toolchain | label | The Node.js toolchain to use for this target. See https://bazelbuild.github.io/rules_nodejs/Toolchains.html Typically this is left unset so that Bazel automatically selects the right Node.js toolchain Default: None |
junit_reporter | label | Default: None |
config | label | Default: None |