Documentation Home
This page describes a pre-release version of Jasmine (7.0.0-pre.2). There may be additional changes, including breaking changes, before the final 7.0.0 release.
The current stable version of Jasmine is 6.3.

Interface: Configuration

Configuration

Members

alwaysListPendingSpecs :boolean|undefined

Whether the default reporter should list pending specs even if there are failures.

Type:
  • boolean | undefined
Default Value:
  • true

globalSetup :function|undefined

A function that will be called exactly once, even in parallel mode, before the test suite runs. This is intended to be used to initialize out-of-process state such as starting up an external service.

If the globalSetup function is async or otherwise returns a promise, Jasmine will wait up to Configuration#globalSetupTimeout milliseconds for it to finish before running specs. Callbacks are not supported.

globalSetup may be run in a different process from the specs. In-process side effects that it causes, including changes to the Jasmine environment, are not guaranteed to affect any or all specs. Use either beforeEach or beforeAll for in-process setup.

Type:
  • function | undefined

globalSetupTimeout :Number|undefined

The number of milliseconds to wait for an asynchronous Configuration#globalSetup to complete.

Type:
  • Number | undefined
Default Value:
  • 5000

globalTeardown :function|undefined

A function that will be called exactly once, even in parallel mode, after the test suite runs. This is intended to be used to clean up out-of-process state such as shutting down an external service.

If the globalTeardown function is async or otherwise returns a promise, Jasmine will wait up to Configuration#globalTeardownTimeout milliseconds for it to finish. Callbacks are not supported.

globalTeardown may be run in a different process from the specs. In-process side effects caused by specs, including changes to the Jasmine environment, are not guaranteed to be visible to globalTeardown. Use either afterEach or afterAll for in-process cleanup.

Type:
  • function | undefined

globalTeardownTimeout :Number|undefined

The number of milliseconds to wait for an asynchronous Configuration#globalTeardown to complete.

Type:
  • Number | undefined
Default Value:
  • 5000

helpers :Array.<string>|undefined

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

Type:
  • Array.<string> | undefined

loader :string|undefined

Specifies a module containing a custom loader that will be used to load config files, source files, spec files, etc.

If provided, it must refer to a module whose default export is a function that loads modules. The function must take a single argument, which will be a module import specifier or file path, and return a promise that resolves to the corresponding loaded module. The argument will be a module import specifier or file path.

Type:
  • string | undefined
Default Value:
  • undefined

reporters :Array.<Reporter>|undefined

An array of reporters. Each object in the array will be passed to Jasmine#addReporter or ParallelRunner#addReporter.

This provides a middle ground between the --reporter= CLI option and full programmatic usage. Note that because reporters are objects with methods, this option can only be used in JavaScript config files (e.g spec/support/jasmine.js), not JSON.

Type:
  • Array.<Reporter> | undefined
See:

requires :Array.<string>|undefined

An array of module names to load at the start of execution.

Type:
  • Array.<string> | undefined

spec_dir :string|undefined

The directory that spec files are contained in, relative to the project base directory.

Type:
  • string | undefined

spec_files :Array.<string>|undefined

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

Type:
  • Array.<string> | undefined