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.0Node.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
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)
- #333: Jasmine5 support: Preserve the upstream jasmine-core^4.1.0 runtime contract; do not silently upgrade to a different Jasmine major.
- #331: Context window parent access: Run the original adapter unit and browser suites using the packed plugin.
- #339: Release notes links: Document the exact upstream tag, commit and package version directly.
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
- Scoped maintenance fork of karma-jasmine@5.1.0; preserve original library/task sources, API, dependencies and engines.
- Replace obsolete lint/release tools with modern development runners, retain functional upstream tests and add packed-consumer integration.
- Gate exact artifacts with full audit, CI, CodeQL, npm provenance and immutable GitHub releases.
5.1.0 (2022-06-16)
Features
- spec-filter: allow custom specFilter (b73dbd6)
5.0.1 (2022-05-13)
Bug Fixes
5.0.0 (2022-04-12)
Bug Fixes
- limit karma peer dependency to ^6.0.0 (d72c124)
Build System
- drop Node.js 10 support (ea691e8)
Features
- deps: update dependencies including jasmine-core (821f094)
BREAKING CHANGES
- The minimum required version of karma is 6.0.0.
- The minimum required version of Node is 12.0.0.
- deps: jasmine-core was updated to the 4.1.0.
Please refer to the release notes for the complete list of changes and migration instructions.
4.0.2 (2022-03-30)
Bug Fixes
- sync package-lock.json and package.json (4dacc5d)
4.0.1 (2020-08-12)
Bug Fixes
4.0.0 (2020-08-11)
chore
BREAKING CHANGES
- Drop support for node 8 (add support for node 14)
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
- adapter: Remove incorrect function and its call. (#183) (cada4a9)
- build: run eslint on npm test (#237) (a12024d)
- console: Re-add Error: to the stack (#228) (d0b980d)
- dep: Depend upon the jasmine-core version we test (#229) (c4dfef5)
- stack: On error in beforeAll/afterAll relevant information to debug are miss… (#232) (cd6f060)
- time: report correct time since Jasmine v2.9.0 (#197) (022ee04), closes #196
- travis: use new syntax for xenial and pin to it. (#236) (cb99ef8)
- return false for every entry is irrelevant (#206) (d7523d0), closes /github.com/karma-runner/karma-jasmine/pull/206#discussion_r186142116
Chores
Features
adapter: log when Jasmine fails because no expect() were run (#238) (646796e)
reporter: On no-single-run and failure, emit a debug URL (#235) (76f092a)
Propagate errors thrown in afterAll blocks (f3fa264), closes #161
update the version to 2.0.0 and restrict node version available to 4.0 (c84316e)
Update deps and drop node v6 to match karma v4.0 (#233) (097eed4), closes #233
feat (adapter): Use jasmine's new configure method (#224) (6663e47), closes #224 #221
BREAKING CHANGES
drop support for node v6
Also update travis config to drop v6 andd v10
stopOnFailure, which was previously documented in karma-jasmine's README, is not configuration option for jasmine. UseoneFailurePerSpecinstead.
Requires peerDependency Jasmine@^3.3.0
- deps: Drop support for node 4.x
3.0.0 (2020-01-04)
Bug Fixes
- build: run eslint on npm test (#237) (a12024d)
- stack: On error in beforeAll/afterAll relevant information to debug are miss… (#232) (cd6f060)
- travis: use new syntax for xenial and pin to it. (#236) (cb99ef8)
Features
- adapter: log when Jasmine fails because no expect() were run (#238) (646796e)
- reporter: On no-single-run and failure, emit a debug URL (#235) (76f092a)
BREAKING CHANGES
drop support for node v6
Also update travis config to drop v6 andd v10
2.0.1 (2018-11-17)
Bug Fixes
2.0.0 (2018-11-15)
Bug Fixes
- adapter: Remove incorrect function and its call. (#183) (cada4a9)
- return false for every entry is irrelevant (#206) (d7523d0), closes /github.com/karma-runner/karma-jasmine/pull/206#discussion_r186142116
- console: Re-add Error: to the stack (#228) (d0b980d)
- time: report correct time since Jasmine v2.9.0 (#197) (022ee04), closes #196
Chores
Features
- Propagate errors thrown in afterAll blocks (f3fa264), closes #161
- update the version to 2.0.0 and restrict node version available to 4.0 (c84316e)
BREAKING CHANGES
stopOnFailure, which was previously documented in karma-jasmine's README, is not configuration option for jasmine. UseoneFailurePerSpecinstead.
Requires peerDependency Jasmine@^3.3.0
- deps: Drop support for node 4.x
1.1.2 (2018-05-02)
Bug Fixes
- adapter: Remove incorrect function and its call. (#183) (cada4a9)
- time: report correct time since Jasmine v2.9.0 (#197) (022ee04), closes #196
Features
- Propagate errors thrown in afterAll blocks (f3fa264), closes #161
- update the version to 2.0.0 and restrict node version available to 4.0 (c84316e)
1.1.1 (2017-12-01)
Features
1.1.0 (2016-12-09)
Bug Fixes
Features
- report status of the spec closes #129 (5b224e2), closes #129
- Support --random and --seed flags (0b59d69), closes #145 #137
1.0.2 (2016-05-04)
Bug Fixes
- version: argh, make 'build' a prereq for test and fix gruntfile for eslint(f2a6109)
1.0.1 (2016-05-04)
Bug Fixes
- grunt: load 'build' grunt task and make a pre-req for releasing(1861ae0)
1.0.0 (2016-05-03)
0.3.8 (2016-03-16)
Bug Fixes
Features
- adapter: add executedExpectationsCount to result (666c207)
Release files and references
- README.md
- UPSTREAM.md
- CHANGELOG.md
- LICENSE
- NOTICE
- Package and publication metadata
- Full text documentation
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.