NodeJS testing
Bazel

NodeJS testing


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, **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

**kwargs

Unknown; Optional

remaining arguments are passed to the test rule