Alexandro.Net

Version 1.0.0

@stackline/karma-jasmine

A Karma plugin - adapter for Jasmine testing framework.

Independent maintenance of karma-jasmine 5.1.0. Original authors and licenses are retained.

Installation

# Preserve existing imports with an npm alias
npm install karma-jasmine@npm:@stackline/karma-jasmine@1.0.0
# Or use the scoped package name in your imports
npm install @stackline/karma-jasmine@1.0.0

Node.js: >=12. Read the compatibility and maintenance notes before migrating.

Usage and API

The reference below may retain upstream package names. Use the alias installation above to run those imports with this Stackline release.

@stackline/karma-jasmine

Independent maintenance fork of karma-jasmine@5.1.0. Original API, module format, runtime dependency ranges, and supported Node.js engines are preserved.

npm install @stackline/karma-jasmine
# Preserve existing imports with an npm alias:
npm install karma-jasmine@npm:@stackline/karma-jasmine@1.0.0

See UPSTREAM.md for the exact source and issue review, and CHANGELOG.md for focused maintenance changes. Development and release tooling runs on Node.js 24; that does not change the library runtime requirement.

Maintained by Stackline. Issues · npm.

Upstream documentation

karma-jasmine

npm version npm downloads Release Workflow Status js-standard-style semantic-release

Adapter for the Jasmine testing framework.

Installation

npm install karma-jasmine --save-dev

Configuration

// karma.conf.js
module.exports = function(config) {
  config.set({
    frameworks: ['jasmine'],
    files: [
      '*.js'
    ]
  })
}

If you want to run only some tests whose name match a given pattern you can do this in the following way

$ karma start &
$ karma run -- --grep=<pattern>

where pattern is either a string (e.g --grep=#slow runs tests containing "#slow") or a Regex (e.g --grep=/^(?!.*#slow).*$/ runs tests not containing "#slow").

You can also pass it to karma.config.js:

module.exports = function(config) {
  config.set({
    // ...
    client: {
      args: ['--grep', '<pattern>'],
      // ...
    }
  })
}

If you want to pass configuration options directly to jasmine you can do this in the following way

module.exports = function(config) {
  config.set({
    client: {
      jasmine: {
        random: true,
        seed: '4321',
        oneFailurePerSpec: true,
        failFast: true,
        timeoutInterval: 1000
      }
    }
  })
}

Debug by URL

Failing tests print a debug URL with ?spec=. Use it with --no_single_run and paste it into your browser to focus on a single failing test.

Sharding

By setting config.client.shardIndex and config.client.totalShards, you can run a subset of the full set of specs. Complete sharding support needs to be done in the process that calls karma, and would need to support test result integration across shards.

Custom spec filter

Providing a custom spec filter is also supported.

Example:

// Users are able to set a custom specFilter themselves

jasmine.getEnv().configure({
  specFilter: function (spec) {
    return spec.getFullName() === 'spec that succeeds'
  }
})

describe('spec', () => {
  it('that fails', () => {
    fail('This spec should not run!')
  })

  it('that succeeds', () => {
    expect(1).toBe(1)
  })
})

For more information on Karma see the homepage.

Upstream issues and maintenance review

Upstream review

Source: karma-jasmine@5.1.0, c3f702a2a567086e6069dd57b0308c2da1a90e37. Existing published runtime files match the integrity-checked upstream npm tarball byte-for-byte. Generated adapter files, where applicable, are built from original sources. License and authorship notices remain unchanged.

Issue triage (2026-09-29)

No upstream contact was made and no blanket issue-resolution claim is implied. Node24 is used for development only; published engine declarations remain unchanged.

Verification

npm ci --ignore-scripts, npm run build --if-present, npm test, npm run test:package, npm audit --audit-level=low. Exact CI tarballs require successful CI and CodeQL before provenance-enabled publication.

Release changes

Stackline changes

1.0.0

5.1.0 (2022-06-16)

Features

5.0.1 (2022-05-13)

Bug Fixes

5.0.0 (2022-04-12)

Bug Fixes

Build System

Features

BREAKING CHANGES

Please refer to the release notes for the complete list of changes and migration instructions.

4.0.2 (2022-03-30)

Bug Fixes

4.0.1 (2020-08-12)

Bug Fixes

4.0.0 (2020-08-11)

chore

BREAKING CHANGES

3.3.1 (2020-05-28)

Bug Fixes

3.3.0 (2020-05-28)

Features

3.2.0 (2020-05-26)

Features

3.1.1 (2020-02-11)

Bug Fixes

3.1.0 (2020-01-10)

Features

3.0.3 (2020-01-08)

Bug Fixes

3.0.2 (2020-01-08)

3.0.1 (2020-01-06)

Bug Fixes

Chores

Features

BREAKING CHANGES

Requires peerDependency Jasmine@^3.3.0

3.0.0 (2020-01-04)

Bug Fixes

Features

BREAKING CHANGES

2.0.1 (2018-11-17)

Bug Fixes

2.0.0 (2018-11-15)

Bug Fixes

Chores

Features

BREAKING CHANGES

Requires peerDependency Jasmine@^3.3.0

1.1.2 (2018-05-02)

Bug Fixes

Features

1.1.1 (2017-12-01)

Features

1.1.0 (2016-12-09)

Bug Fixes

Features

1.0.2 (2016-05-04)

Bug Fixes

1.0.1 (2016-05-04)

Bug Fixes

1.0.0 (2016-05-03)

0.3.8 (2016-03-16)

Bug Fixes

Features

Release files and references

Package bytes, npm provenance and the immutable GitHub release were verified for this version. Security checks describe the reviewed release; documented compatibility risks and upstream reports are not blanket claims of resolution.