karma-jasmine
Advanced tools
Comparing version 4.0.2 to 5.1.0
@@ -353,3 +353,3 @@ (function(window) { | ||
if (location && Object.prototype.hasOwnProperty.call(location, 'search')) { | ||
var pairs = location.search.substr(1).split('&') | ||
var pairs = location.search.slice(1).split('&') | ||
for (var i = 0; i < pairs.length; i++) { | ||
@@ -463,7 +463,6 @@ var keyValue = pairs[i].split('=') | ||
this.specIdsToRun = | ||
getSpecsToRun(window.location, clientConfig, jasmineEnv).map(getId) | ||
this.specIdsToRun = new Set(getSpecsToRun(window.location, clientConfig, jasmineEnv).map(getId)) | ||
this.matches = function (spec) { | ||
return this.specIdsToRun.indexOf(spec.id) !== -1 | ||
return this.specIdsToRun.has(spec.id) | ||
} | ||
@@ -484,4 +483,5 @@ } | ||
var originalSpecFilter = jasmineEnv.configuration().specFilter | ||
var specFilter = function (spec) { | ||
return karmaSpecFilter.matches(spec) | ||
return originalSpecFilter(spec) && karmaSpecFilter.matches(spec) | ||
} | ||
@@ -511,3 +511,2 @@ | ||
jasmineConfig.specFilter = createSpecFilter(clientConfig, jasmineEnv) | ||
jasmineEnv.configure(jasmineConfig) | ||
@@ -514,0 +513,0 @@ |
{ | ||
"name": "karma-jasmine", | ||
"version": "4.0.2", | ||
"version": "5.1.0", | ||
"description": "A Karma plugin - adapter for Jasmine testing framework.", | ||
@@ -31,29 +31,29 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"jasmine-core": "^3.6.0" | ||
"jasmine-core": "^4.1.0" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^12.1.4", | ||
"@commitlint/config-angular": "^12.1.4", | ||
"@semantic-release/changelog": "^5.0.1", | ||
"@semantic-release/git": "^9.0.1", | ||
"@semantic-release/github": "^7.2.3", | ||
"@semantic-release/npm": "^7.1.3", | ||
"eslint": "^8.11.0", | ||
"eslint-config-standard": "^14.1.1", | ||
"eslint-plugin-import": "^2.22.0", | ||
"@commitlint/cli": "^16.2.3", | ||
"@commitlint/config-angular": "^16.2.3", | ||
"@semantic-release/changelog": "^6.0.1", | ||
"@semantic-release/git": "^10.0.1", | ||
"@semantic-release/github": "^8.0.4", | ||
"@semantic-release/npm": "^9.0.1", | ||
"eslint": "^7.32.0", | ||
"eslint-config-standard": "^16.0.3", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"grunt": "^1.4.1", | ||
"husky": "^4.2.5", | ||
"jasmine": "^3.6.1", | ||
"karma": "^4.4.1", | ||
"karma-firefox-launcher": "^1.3.0", | ||
"semantic-release": "^17.4.7" | ||
"eslint-plugin-promise": "^5.2.0", | ||
"eslint-plugin-standard": "^4.1.0", | ||
"grunt": "^1.5.2", | ||
"husky": "^4.3.8", | ||
"jasmine": "^4.1.0", | ||
"karma": "^6.3.18", | ||
"karma-firefox-launcher": "^2.1.2", | ||
"semantic-release": "^19.0.2" | ||
}, | ||
"peerDependencies": { | ||
"karma": "*" | ||
"karma": "^6.0.0" | ||
}, | ||
"engines": { | ||
"node": ">= 10" | ||
"node": ">=12" | ||
}, | ||
@@ -72,8 +72,8 @@ "husky": { | ||
"Friedel Ziegelmayer <dignifiedquire@gmail.com>", | ||
"XhmikosR <xhmikosr@gmail.com>", | ||
"olegskl <sklyanchuk@gmail.com>", | ||
"semantic-release-bot <semantic-release-bot@martynus.net>", | ||
"dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>", | ||
"dignifiedquire <dignifiedquire@gmail.com>", | ||
"semantic-release-bot <semantic-release-bot@martynus.net>", | ||
"Cornelius Schmale <github@cschmale.de>", | ||
"XhmikosR <xhmikosr@gmail.com>", | ||
"Arthur Thornton <arthur@thestorefront.com>", | ||
@@ -84,2 +84,3 @@ "Friedel Ziegelmayer <friedel.ziegelmayer@gmail.com>", | ||
"Fernando Costa <fadc80@gmail.com>", | ||
"Nico Jansen <jansennico@gmail.com>", | ||
"Aaron Hartwig <aaron.hartwig@whyhigh.com>", | ||
@@ -90,2 +91,3 @@ "Alesei N <github.com@bzik.net>", | ||
"Dmitriy Tychshenko <dtychshenko@users.noreply.github.com>", | ||
"Flavian Hautbois <flavian@apricity.life>", | ||
"Georgii Dolzhykov <thorn.mailbox@gmail.com>", | ||
@@ -101,6 +103,6 @@ "Gregg Van Hove <gvanhove@pivotal.io>", | ||
"Milan Lempera <milanlempera@gmail.com>", | ||
"Nico Jansen <jansennico@gmail.com>", | ||
"Niels Dequeker <niels.dequeker@gmail.com>", | ||
"Robin Gloster <robin@loc-com.de>", | ||
"Sahat Yalkabov <sakhat@gmail.com>", | ||
"Sampo Kivistö <sampo.kivisto@visma.com>", | ||
"Schaaf, Martin <703355+mschaaf@users.noreply.github.com>", | ||
@@ -110,2 +112,3 @@ "Sergey Tatarintsev <sevinf@yandex-team.ru>", | ||
"Stefan Dragnev <dragnev@telerik.com>", | ||
"Tobias Speicher <rootcommander@gmail.com>", | ||
"Todd Wolfson <todd@twolfson.com>", | ||
@@ -112,0 +115,0 @@ "Vladimir Belov <Vladimir.Belov@hotmail.com>", |
# karma-jasmine | ||
[![npm version](https://img.shields.io/npm/v/karma-jasmine.svg?style=flat-square)](https://www.npmjs.com/package/karma-jasmine) [![npm downloads](https://img.shields.io/npm/dm/karma-jasmine.svg?style=flat-square)](https://www.npmjs.com/package/karma-jasmine) | ||
[![npm version](https://img.shields.io/npm/v/karma-jasmine?style=flat-square)](https://www.npmjs.com/package/karma-jasmine) | ||
[![npm downloads](https://img.shields.io/npm/dm/karma-jasmine?style=flat-square)](https://www.npmjs.com/package/karma-jasmine) | ||
[![Release Workflow Status](https://img.shields.io/github/workflow/status/karma-runner/karma-jasmine/Release/master?style=flat-square&logo=github&label=Release)](https://github.com/karma-runner/karma-jasmine/actions/workflows/release.yml?query=branch%3Amaster) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen?style=flat-square)](https://github.com/karma-runner/karma-jasmine) | ||
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079?style=flat-square)](https://github.com/semantic-release/semantic-release) | ||
[![Build Status](https://img.shields.io/travis/karma-runner/karma-jasmine/master.svg?style=flat-square)](https://travis-ci.org/karma-runner/karma-jasmine) [![Dependency Status](https://img.shields.io/david/karma-runner/karma-jasmine.svg?style=flat-square)](https://david-dm.org/karma-runner/karma-jasmine) [![devDependency Status](https://img.shields.io/david/dev/karma-runner/karma-jasmine.svg?style=flat-square)](https://david-dm.org/karma-runner/karma-jasmine?type=dev) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/karma-runner/karma-jasmine) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) | ||
> Adapter for the [Jasmine](https://jasmine.github.io/) testing framework. | ||
@@ -24,3 +24,2 @@ | ||
frameworks: ['jasmine'], | ||
files: [ | ||
@@ -33,3 +32,3 @@ '*.js' | ||
If you want to run only some tests matching a given pattern you can do this in the following way | ||
If you want to run only some tests whose name match a given pattern you can do this in the following way | ||
@@ -41,11 +40,13 @@ ```bash | ||
or | ||
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`: | ||
```js | ||
module.exports = function(config) { | ||
config.set({ | ||
... | ||
// ... | ||
client: { | ||
args: ['--grep', '<pattern>'], | ||
... | ||
// ... | ||
} | ||
@@ -86,4 +87,30 @@ }) | ||
## Custom spec filter | ||
Providing a [custom spec filter](https://jasmine.github.io/api/edge/Configuration#specFilter) is also supported. | ||
Example: | ||
```js | ||
// 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](https://karma-runner.github.com/). | ||
For more information on Karma see the [homepage](https://karma-runner.github.io/). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26554
113
+ Added@types/node@22.7.7(transitive)
+ Addedjasmine-core@4.6.1(transitive)
- Removed@types/node@22.7.8(transitive)
- Removedjasmine-core@3.99.1(transitive)
Updatedjasmine-core@^4.1.0