Interface: Configuration

Configuration

Specifies the properties of the configuration file, as well as the argument to runSpecs.

Extends

Members

alwaysListPendingSpecs :boolean|undefined

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

Type:
  • boolean | undefined
Default Value:
  • true

browser :string|BrowserInfo|undefined

The browser to run the specs in.

Type:

color :boolean|undefined

Whether to use color in the console output.

Type:
  • boolean | undefined
Default Value:
  • true

cssFiles :Array.<string>|undefined

An array of CSS file paths or globs that match CSS files. Each path or glob will be evaluated relative to ServerCtorOptions#srcDir.

Type:
  • Array.<string> | undefined
Inherited From:

enableTopLevelAwait :boolean|undefined

Whether to enable support for top-level await. This option is off by default because it comes with a performance penalty.

Type:
  • boolean | undefined
Default Value:
  • false

esmFilenameExtension :string|undefined

The file extension used by ES modules

Type:
  • string | undefined
Inherited From:
Default Value:
  • ".mjs"

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 ServerCtorOptions#specDir. Helpers are loaded before specs.

Type:
  • Array.<string> | undefined
Inherited From:

importMap :ImportMap|undefined

Import maps entry to generate the <script type="importmap"> section in the <head>, to enable ES Module testing in the browser.

Type:
Default Value:
  • undefined

jasmineCore :any|undefined

The instance of jasmine-core to use. Use this if you need to load jasmine-core in a nonstandard way. Most of the time it should be omitted.

Type:
  • any | undefined
Inherited From:

middleware :object|undefined

An optional map from paths to Express application middleware to mount on those paths. This can be used to serve static files, proxy requests to another server, etc.

Note: Requests made by jasmine-browser-runner (e.g. /, /__jasmine__/*, /__spec__/*, etc) are considered private APIs for semver purposes. If you configure middleware that modifies these requests and responses, there is a possibility that future jasmine-browser-runner releases, including minor and patch releases, may be incompatible with that middleware.

Type:
  • object | undefined
Default Value:
  • undefined
Example
// jasmine-browser.js
const express = require('express');

module.exports = {
  // ...
  middleware: {
    '/assets': express.static('./path/to/assets')
  }
}

port :number|undefined

The port to listen on.

Type:
  • number | undefined
Inherited From:

projectBaseDir :string|undefined

The root directory of the project.

Type:
  • string | undefined
Inherited From:

reporters :Array.<(string|Reporter)>

An array of reporters or names of modules defining reporters. If an entry is a string, it should be the import specifier for a module that default exports a reporter constructor. The constructor will be called with no arguments.

Type:
  • Array.<(string|Reporter)>

specDir :string

The directory that spec files are contained in, relative to ServerCtorOptions#projectBaseDir.

Type:
  • string
Inherited From:

specFiles :Array.<string>|undefined

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

Type:
  • Array.<string> | undefined
Inherited From:

srcDir :string

The directory that source files are contained in, relative to ServerCtorOptions#projectBaseDir.

Type:
  • string
Inherited From:

srcFiles :Array.<string>|undefined

An array of sourec file paths or globs that match source files. Each path or glob will be evaluated relative to ServerCtorOptions#srcDir.

Type:
  • Array.<string> | undefined
Inherited From:

useConsoleReporter :boolean|undefined

Whether to use the built-in ConsoleReporter.

Type:
  • boolean | undefined
Default Value:
  • true

useHtmlReporter :boolean|undefined

Whether to use Jasmine's default HTML reporter.

Type:
  • boolean | undefined
Inherited From:
Default Value:
  • true