Documentation Home
This page is for an older version of Jasmine (5.2).
The current stable version of Jasmine is: 5.5. You can also look at the docs for the next release: Edge

Class: Runner

Runner

Defines common methods and properties of Jasmine and ParallelRunner.
Note: This should be considered an interface. It's only documented as a class due to jsdoc limitations. You can safely assume that these members are available on both runner classes, but the inheritance structure itself is an implementation detail that may change at any time.

Members

exitOnCompletion :boolean

Whether to cause the Node process to exit when the suite finishes executing.

Type:
  • boolean
Default Value:
  • true

Methods

addHelperFile(filePath)

Adds a helper file to the list that will be loaded when the suite is executed.

Parameters:
Name Type Description
filePath string

The path to the file to be loaded.

addMatchingHelperFiles(patterns)

Adds files that match the specified patterns to the list of helper files.

Parameters:
Name Type Description
patterns Array.<string>

An array of helper file paths or globs that match helper files. Each path or glob will be evaluated relative to the spec directory.

addMatchingSpecFiles(patterns)

Adds files that match the specified patterns to the list of spec files.

Parameters:
Name Type Description
patterns Array.<string>

An array of spec file paths or globs that match spec files. Each path or glob will be evaluated relative to the spec directory.

addReporter(reporter)

Add a custom reporter to the Jasmine environment.

Parameters:
Name Type Description
reporter Reporter

The reporter to add

See:

addSpecFile(filePath)

Adds a spec file to the list that will be loaded when the suite is executed.

Parameters:
Name Type Description
filePath string

The path to the file to be loaded.

alwaysListPendingSpecs(value)

Sets whether the console reporter should list pending specs even when there are failures.

Parameters:
Name Type Description
value boolean

clearReporters()

Clears all registered reporters.

configureDefaultReporter(options)

Configures the default reporter that is installed if no other reporter is specified.

Parameters:
Name Type Description
options ConsoleReporterOptions

loadConfig(config)

Loads configuration from the specified object.

Parameters:
Name Type Description
config Configuration

loadConfigFile(configFilePathopt)

Loads configuration from the specified file. The file can be a JSON file or any JS file that's loadable as a module and provides a Jasmine config as its default export.

The config file will be loaded via dynamic import() unless this Jasmine instance has already been configured with {jsLoader: 'require'}. Dynamic import() supports ES modules as well as nearly all CommonJS modules.

Parameters:
Name Type Attributes Default Description
configFilePath string <optional>
spec/support/jasmine.json
Returns:

Promise

showColors(value)

Sets whether to show colors in the console reporter.

Parameters:
Name Type Description
value boolean

Whether to show colors

verbose(value)

Sets whether to run in verbose mode, which prints information that may be useful for debugging configuration problems.

Parameters:
Name Type Description
value boolean

Whether to run in verbose mode