Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

jasmine-core

Package Overview
Dependencies
Maintainers
3
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasmine-core - npm Package Compare versions

Comparing version 3.99.1 to 4.6.0

56

lib/jasmine-core.js

@@ -1,15 +0,51 @@

module.exports = require("./jasmine-core/jasmine.js");
/**
* Note: Only available on Node.
* @module jasmine-core
*/
const jasmineRequire = require('./jasmine-core/jasmine.js');
module.exports = jasmineRequire;
/**
* Boots a copy of Jasmine and returns an object as described in {@link jasmine}.
* @type {function}
* @return {jasmine}
*/
module.exports.boot = require('./jasmine-core/node_boot.js');
var path = require('path'),
fs = require('fs');
/**
* Boots a copy of Jasmine and returns an object containing the properties
* that would normally be added to the global object. If noGlobals is called
* multiple times, the same object is returned every time.
*
* Do not call boot() if you also call noGlobals().
*
* @example
* const {describe, beforeEach, it, expect, jasmine} = require('jasmine-core').noGlobals();
*/
module.exports.noGlobals = (function() {
let jasmineInterface;
var rootPath = path.join(__dirname, "jasmine-core"),
bootFiles = ['boot0.js', 'boot1.js'],
legacyBootFiles = ['boot.js'],
nodeBootFiles = ['node_boot.js'],
cssFiles = [],
jsFiles = [],
jsFilesToSkip = ['jasmine.js'].concat(bootFiles, legacyBootFiles, nodeBootFiles);
return function bootWithoutGlobals() {
if (!jasmineInterface) {
const jasmine = jasmineRequire.core(jasmineRequire);
const env = jasmine.getEnv({ suppressLoadErrors: true });
jasmineInterface = jasmineRequire.interface(jasmine, env);
}
return jasmineInterface;
};
}());
const path = require('path'),
fs = require('fs');
const rootPath = path.join(__dirname, 'jasmine-core'),
bootFiles = ['boot0.js', 'boot1.js'],
legacyBootFiles = ['boot.js'],
nodeBootFiles = ['node_boot.js'],
cssFiles = [],
jsFiles = [],
jsFilesToSkip = ['jasmine.js'].concat(bootFiles, legacyBootFiles, nodeBootFiles);
fs.readdirSync(rootPath).forEach(function(file) {

@@ -16,0 +52,0 @@ if(fs.statSync(path.join(rootPath, file)).isFile()) {

14

lib/jasmine-core/boot0.js
/*
Copyright (c) 2008-2022 Pivotal Labs
Copyright (c) 2008-2023 Pivotal Labs

@@ -30,3 +30,3 @@ Permission is hereby granted, free of charge, to any person obtaining

(function() {
var jasmineRequire = window.jasmineRequire || require('./jasmine.js');
const jasmineRequire = window.jasmineRequire || require('./jasmine.js');

@@ -38,3 +38,3 @@ /**

*/
var jasmine = jasmineRequire.core(jasmineRequire),
const jasmine = jasmineRequire.core(jasmineRequire),
global = jasmine.getGlobal();

@@ -51,3 +51,3 @@ global.jasmine = jasmine;

*/
var env = jasmine.getEnv();
const env = jasmine.getEnv();

@@ -59,3 +59,3 @@ /**

*/
var jasmineInterface = jasmineRequire.interface(jasmine, env);
const jasmineInterface = jasmineRequire.interface(jasmine, env);

@@ -65,5 +65,5 @@ /**

*/
for (var property in jasmineInterface) {
for (const property in jasmineInterface) {
global[property] = jasmineInterface[property];
}
}());
})();
/*
Copyright (c) 2008-2022 Pivotal Labs
Copyright (c) 2008-2023 Pivotal Labs

@@ -24,3 +24,3 @@ Permission is hereby granted, free of charge, to any person obtaining

/**
This file finishes "booting" Jasmine, performing all of the necessary
This file finishes 'booting' Jasmine, performing all of the necessary
initialization before executing the loaded environment and all of a project's

@@ -38,3 +38,3 @@ specs. This file should be loaded after `boot0.js` but before any project

(function() {
var env = jasmine.getEnv();
const env = jasmine.getEnv();

@@ -47,21 +47,25 @@ /**

var queryString = new jasmine.QueryString({
getWindowLocation: function() { return window.location; }
const queryString = new jasmine.QueryString({
getWindowLocation: function() {
return window.location;
}
});
var filterSpecs = !!queryString.getParam("spec");
const filterSpecs = !!queryString.getParam('spec');
var config = {
stopOnSpecFailure: queryString.getParam("failFast"),
stopSpecOnExpectationFailure: queryString.getParam("oneFailurePerSpec"),
hideDisabled: queryString.getParam("hideDisabled")
const config = {
stopOnSpecFailure: queryString.getParam('stopOnSpecFailure'),
stopSpecOnExpectationFailure: queryString.getParam(
'stopSpecOnExpectationFailure'
),
hideDisabled: queryString.getParam('hideDisabled')
};
var random = queryString.getParam("random");
const random = queryString.getParam('random');
if (random !== undefined && random !== "") {
if (random !== undefined && random !== '') {
config.random = random;
}
var seed = queryString.getParam("seed");
const seed = queryString.getParam('seed');
if (seed) {

@@ -75,9 +79,19 @@ config.seed = seed;

*/
var htmlReporter = new jasmine.HtmlReporter({
const htmlReporter = new jasmine.HtmlReporter({
env: env,
navigateWithNewParam: function(key, value) { return queryString.navigateWithNewParam(key, value); },
addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
getContainer: function() { return document.body; },
createElement: function() { return document.createElement.apply(document, arguments); },
createTextNode: function() { return document.createTextNode.apply(document, arguments); },
navigateWithNewParam: function(key, value) {
return queryString.navigateWithNewParam(key, value);
},
addToExistingQueryString: function(key, value) {
return queryString.fullStringWithNewParam(key, value);
},
getContainer: function() {
return document.body;
},
createElement: function() {
return document.createElement.apply(document, arguments);
},
createTextNode: function() {
return document.createTextNode.apply(document, arguments);
},
timer: new jasmine.Timer(),

@@ -96,4 +110,6 @@ filterSpecs: filterSpecs

*/
var specFilter = new jasmine.HtmlSpecFilter({
filterString: function() { return queryString.getParam("spec"); }
const specFilter = new jasmine.HtmlSpecFilter({
filterString: function() {
return queryString.getParam('spec');
}
});

@@ -108,10 +124,2 @@

/**
* Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
*/
window.setTimeout = window.setTimeout;
window.setInterval = window.setInterval;
window.clearTimeout = window.clearTimeout;
window.clearInterval = window.clearInterval;
/**
* ## Execution

@@ -121,3 +129,3 @@ *

*/
var currentWindowOnload = window.onload;
const currentWindowOnload = window.onload;

@@ -131,11 +139,2 @@ window.onload = function() {

};
/**
* Helper function for readability above.
*/
function extend(destination, source) {
for (var property in source) destination[property] = source[property];
return destination;
}
}());
})();

@@ -1,24 +0,24 @@

function Player() {
}
Player.prototype.play = function(song) {
this.currentlyPlayingSong = song;
this.isPlaying = true;
};
class Player {
play(song) {
this.currentlyPlayingSong = song;
this.isPlaying = true;
}
Player.prototype.pause = function() {
this.isPlaying = false;
};
pause() {
this.isPlaying = false;
}
Player.prototype.resume = function() {
if (this.isPlaying) {
throw new Error("song is already playing");
resume() {
if (this.isPlaying) {
throw new Error('song is already playing');
}
this.isPlaying = true;
}
this.isPlaying = true;
};
makeFavorite() {
this.currentlyPlayingSong.persistFavoriteStatus(true);
}
}
Player.prototype.makeFavorite = function() {
this.currentlyPlayingSong.persistFavoriteStatus(true);
};
module.exports = Player;

@@ -1,9 +0,8 @@

function Song() {
class Song {
persistFavoriteStatus(value) {
// something complicated
throw new Error('not yet implemented');
}
}
Song.prototype.persistFavoriteStatus = function(value) {
// something complicated
throw new Error("not yet implemented");
};
module.exports = Song;

@@ -6,7 +6,7 @@ beforeEach(function () {

compare: function (actual, expected) {
var player = actual;
const player = actual;
return {
pass: player.currentlyPlayingSong === expected && player.isPlaying
}
};
}

@@ -13,0 +13,0 @@ };

@@ -1,7 +0,8 @@

describe("Player", function() {
var Player = require('../../lib/jasmine_examples/Player');
var Song = require('../../lib/jasmine_examples/Song');
var player;
var song;
const Player = require('../../lib/jasmine_examples/Player');
const Song = require('../../lib/jasmine_examples/Song');
describe('Player', function() {
let player;
let song;
beforeEach(function() {

@@ -12,11 +13,11 @@ player = new Player();

it("should be able to play a Song", function() {
it('should be able to play a Song', function() {
player.play(song);
expect(player.currentlyPlayingSong).toEqual(song);
//demonstrates use of custom matcher
// demonstrates use of custom matcher
expect(player).toBePlaying(song);
});
describe("when song has been paused", function() {
describe('when song has been paused', function() {
beforeEach(function() {

@@ -27,3 +28,3 @@ player.play(song);

it("should indicate that the song is currently paused", function() {
it('should indicate that the song is currently paused', function() {
expect(player.isPlaying).toBeFalsy();

@@ -35,3 +36,3 @@

it("should be possible to resume", function() {
it('should be possible to resume', function() {
player.resume();

@@ -44,3 +45,3 @@ expect(player.isPlaying).toBeTruthy();

// demonstrates use of spies to intercept and test method calls
it("tells the current song if the user has made it a favorite", function() {
it('tells the current song if the user has made it a favorite', function() {
spyOn(song, 'persistFavoriteStatus');

@@ -55,4 +56,4 @@

//demonstrates use of expected exceptions
describe("#resume", function() {
it("should throw an exception if song is already playing", function() {
describe('#resume', function() {
it('should throw an exception if song is already playing', function() {
player.play(song);

@@ -62,5 +63,5 @@

player.resume();
}).toThrowError("song is already playing");
}).toThrowError('song is already playing');
});
});
});

@@ -1,4 +0,4 @@

describe("Player", function() {
var player;
var song;
describe('Player', function() {
let player;
let song;

@@ -10,11 +10,11 @@ beforeEach(function() {

it("should be able to play a Song", function() {
it('should be able to play a Song', function() {
player.play(song);
expect(player.currentlyPlayingSong).toEqual(song);
//demonstrates use of custom matcher
// demonstrates use of custom matcher
expect(player).toBePlaying(song);
});
describe("when song has been paused", function() {
describe('when song has been paused', function() {
beforeEach(function() {

@@ -25,3 +25,3 @@ player.play(song);

it("should indicate that the song is currently paused", function() {
it('should indicate that the song is currently paused', function() {
expect(player.isPlaying).toBeFalsy();

@@ -33,3 +33,3 @@

it("should be possible to resume", function() {
it('should be possible to resume', function() {
player.resume();

@@ -42,3 +42,3 @@ expect(player.isPlaying).toBeTruthy();

// demonstrates use of spies to intercept and test method calls
it("tells the current song if the user has made it a favorite", function() {
it('tells the current song if the user has made it a favorite', function() {
spyOn(song, 'persistFavoriteStatus');

@@ -53,4 +53,4 @@

//demonstrates use of expected exceptions
describe("#resume", function() {
it("should throw an exception if song is already playing", function() {
describe('#resume', function() {
it('should throw an exception if song is already playing', function() {
player.play(song);

@@ -60,5 +60,5 @@

player.resume();
}).toThrowError("song is already playing");
}).toThrowError('song is already playing');
});
});
});

@@ -6,3 +6,3 @@ beforeEach(function () {

compare: function (actual, expected) {
var player = actual;
const player = actual;

@@ -9,0 +9,0 @@ return {

@@ -1,22 +0,22 @@

function Player() {
}
Player.prototype.play = function(song) {
this.currentlyPlayingSong = song;
this.isPlaying = true;
};
class Player {
play(song) {
this.currentlyPlayingSong = song;
this.isPlaying = true;
}
Player.prototype.pause = function() {
this.isPlaying = false;
};
pause() {
this.isPlaying = false;
}
Player.prototype.resume = function() {
if (this.isPlaying) {
throw new Error("song is already playing");
resume() {
if (this.isPlaying) {
throw new Error('song is already playing');
}
this.isPlaying = true;
}
this.isPlaying = true;
};
Player.prototype.makeFavorite = function() {
this.currentlyPlayingSong.persistFavoriteStatus(true);
};
makeFavorite() {
this.currentlyPlayingSong.persistFavoriteStatus(true);
}
}

@@ -1,7 +0,6 @@

function Song() {
class Song {
persistFavoriteStatus(value) {
// something complicated
throw new Error('not yet implemented');
}
}
Song.prototype.persistFavoriteStatus = function(value) {
// something complicated
throw new Error("not yet implemented");
};
/*
Copyright (c) 2008-2022 Pivotal Labs
Copyright (c) 2008-2023 Pivotal Labs

@@ -23,2 +23,3 @@ Permission is hereby granted, free of charge, to any person obtaining

*/
// eslint-disable-next-line no-var
var jasmineRequire = window.jasmineRequire || require('./jasmine.js');

@@ -76,17 +77,25 @@

ResultsStateBuilder.prototype.jasmineDone = function(result) {
if (result.failedExpectations) {
this.failureCount += result.failedExpectations.length;
}
};
function HtmlReporter(options) {
var config = function() {
return (options.env && options.env.configuration()) || {};
},
getContainer = options.getContainer,
createElement = options.createElement,
createTextNode = options.createTextNode,
navigateWithNewParam = options.navigateWithNewParam || function() {},
addToExistingQueryString =
options.addToExistingQueryString || defaultQueryString,
filterSpecs = options.filterSpecs,
htmlReporterMain,
symbols,
deprecationWarnings = [];
function config() {
return (options.env && options.env.configuration()) || {};
}
const getContainer = options.getContainer;
const createElement = options.createElement;
const createTextNode = options.createTextNode;
const navigateWithNewParam = options.navigateWithNewParam || function() {};
const addToExistingQueryString =
options.addToExistingQueryString || defaultQueryString;
const filterSpecs = options.filterSpecs;
let htmlReporterMain;
let symbols;
const deprecationWarnings = [];
const failures = [];
this.initialize = function() {

@@ -118,3 +127,3 @@ clearPrior();

var totalSpecsDefined;
let totalSpecsDefined;
this.jasmineStarted = function(options) {

@@ -124,5 +133,5 @@ totalSpecsDefined = options.totalSpecsDefined || 0;

var summary = createDom('div', { className: 'jasmine-summary' });
const summary = createDom('div', { className: 'jasmine-summary' });
var stateBuilder = new ResultsStateBuilder();
const stateBuilder = new ResultsStateBuilder();

@@ -146,3 +155,2 @@ this.suiteStarted = function(result) {

var failures = [];
this.specDone = function(result) {

@@ -152,3 +160,3 @@ stateBuilder.specDone(result);

if (noExpectations(result)) {
var noSpecMsg = "Spec '" + result.fullName + "' has no expectations.";
const noSpecMsg = "Spec '" + result.fullName + "' has no expectations.";
if (result.status === 'failed') {

@@ -196,6 +204,7 @@ console.error(noSpecMsg);

this.jasmineDone = function(doneResult) {
var banner = find('.jasmine-banner');
var alert = find('.jasmine-alert');
var order = doneResult && doneResult.order;
var i;
stateBuilder.jasmineDone(doneResult);
const banner = find('.jasmine-banner');
const alert = find('.jasmine-alert');
const order = doneResult && doneResult.order;
alert.appendChild(

@@ -212,3 +221,3 @@ createDom(

if (stateBuilder.specsExecuted < totalSpecsDefined) {
var skippedMessage =
const skippedMessage =
'Ran ' +

@@ -220,3 +229,3 @@ stateBuilder.specsExecuted +

// include window.location.pathname to fix issue with karma-jasmine-html-reporter in angular: see https://github.com/jasmine/jasmine/issues/1906
var skippedLink =
const skippedLink =
(window.location.pathname || '') +

@@ -236,6 +245,7 @@ addToExistingQueryString('spec', '');

}
var statusBarMessage = '';
var statusBarClassName = 'jasmine-overall-result jasmine-bar ';
var globalFailures = (doneResult && doneResult.failedExpectations) || [];
var failed = stateBuilder.failureCount + globalFailures.length > 0;
let statusBarMessage = '';
let statusBarClassName = 'jasmine-overall-result jasmine-bar ';
const globalFailures =
(doneResult && doneResult.failedExpectations) || [];
const failed = stateBuilder.failureCount + globalFailures.length > 0;

@@ -266,3 +276,3 @@ if (totalSpecsDefined > 0 || failed) {

var seedBar;
let seedBar;
if (order && order.random) {

@@ -293,6 +303,6 @@ seedBar = createDom(

var errorBarClassName = 'jasmine-bar jasmine-errored';
var afterAllMessagePrefix = 'AfterAll ';
const errorBarClassName = 'jasmine-bar jasmine-errored';
const afterAllMessagePrefix = 'AfterAll ';
for (i = 0; i < globalFailures.length; i++) {
for (let i = 0; i < globalFailures.length; i++) {
alert.appendChild(

@@ -309,3 +319,3 @@ createDom(

if (failure.globalErrorType === 'load') {
var prefix = 'Error during loading: ' + failure.message;
const prefix = 'Error during loading: ' + failure.message;

@@ -319,4 +329,6 @@ if (failure.filename) {

}
} else if (failure.globalErrorType === 'afterAll') {
return afterAllMessagePrefix + failure.message;
} else {
return afterAllMessagePrefix + failure.message;
return failure.message;
}

@@ -327,5 +339,5 @@ }

for (i = 0; i < deprecationWarnings.length; i++) {
var children = [],
context;
for (let i = 0; i < deprecationWarnings.length; i++) {
const children = [];
let context;

@@ -364,3 +376,3 @@ switch (deprecationWarnings[i].runnableType) {

var results = find('.jasmine-results');
const results = find('.jasmine-results');
results.appendChild(summary);

@@ -407,4 +419,4 @@

var failureNode = find('.jasmine-failures');
for (i = 0; i < failures.length; i++) {
const failureNode = find('.jasmine-failures');
for (let i = 0; i < failures.length; i++) {
failureNode.appendChild(failures[i]);

@@ -418,3 +430,3 @@ }

function failureDom(result) {
var failure = createDom(
const failure = createDom(
'div',

@@ -425,6 +437,6 @@ { className: 'jasmine-spec-detail jasmine-failed' },

);
var messages = failure.childNodes[1];
const messages = failure.childNodes[1];
for (var i = 0; i < result.failedExpectations.length; i++) {
var expectation = result.failedExpectations[i];
for (let i = 0; i < result.failedExpectations.length; i++) {
const expectation = result.failedExpectations[i];
messages.appendChild(

@@ -456,9 +468,53 @@ createDom(

if (result.debugLogs) {
messages.appendChild(debugLogTable(result.debugLogs));
}
return failure;
}
function debugLogTable(debugLogs) {
const tbody = createDom('tbody');
debugLogs.forEach(function(entry) {
tbody.appendChild(
createDom(
'tr',
{},
createDom('td', {}, entry.timestamp.toString()),
createDom('td', {}, entry.message)
)
);
});
return createDom(
'div',
{ className: 'jasmine-debug-log' },
createDom(
'div',
{ className: 'jasmine-debug-log-header' },
'Debug logs'
),
createDom(
'table',
{},
createDom(
'thead',
{},
createDom(
'tr',
{},
createDom('th', {}, 'Time (ms)'),
createDom('th', {}, 'Message')
)
),
tbody
)
);
}
function summaryList(resultsTree, domParent) {
var specListNode;
for (var i = 0; i < resultsTree.children.length; i++) {
var resultNode = resultsTree.children[i];
let specListNode;
for (let i = 0; i < resultsTree.children.length; i++) {
const resultNode = resultsTree.children[i];
if (filterSpecs && !hasActiveSpec(resultNode)) {

@@ -468,3 +524,3 @@ continue;

if (resultNode.type === 'suite') {
var suiteListNode = createDom(
const suiteListNode = createDom(
'ul',

@@ -494,3 +550,3 @@ { className: 'jasmine-suite', id: 'suite-' + resultNode.result.id },

}
var specDescription = resultNode.result.description;
let specDescription = resultNode.result.description;
if (noExpectations(resultNode.result)) {

@@ -527,3 +583,3 @@ specDescription = 'SPEC HAS NO EXPECTATIONS ' + specDescription;

function optionsMenu(config) {
var optionsMenuDom = createDom(
const optionsMenuDom = createDom(
'div',

@@ -594,9 +650,11 @@ { className: 'jasmine-run-options' },

var failFastCheckbox = optionsMenuDom.querySelector('#jasmine-fail-fast');
const failFastCheckbox = optionsMenuDom.querySelector(
'#jasmine-fail-fast'
);
failFastCheckbox.checked = config.stopOnSpecFailure;
failFastCheckbox.onclick = function() {
navigateWithNewParam('failFast', !config.stopOnSpecFailure);
navigateWithNewParam('stopOnSpecFailure', !config.stopOnSpecFailure);
};
var throwCheckbox = optionsMenuDom.querySelector(
const throwCheckbox = optionsMenuDom.querySelector(
'#jasmine-throw-failures'

@@ -607,3 +665,3 @@ );

navigateWithNewParam(
'oneFailurePerSpec',
'stopSpecOnExpectationFailure',
!config.stopSpecOnExpectationFailure

@@ -613,3 +671,3 @@ );

var randomCheckbox = optionsMenuDom.querySelector(
const randomCheckbox = optionsMenuDom.querySelector(
'#jasmine-random-order'

@@ -622,3 +680,5 @@ );

var hideDisabled = optionsMenuDom.querySelector('#jasmine-hide-disabled');
const hideDisabled = optionsMenuDom.querySelector(
'#jasmine-hide-disabled'
);
hideDisabled.checked = config.hideDisabled;

@@ -629,3 +689,3 @@ hideDisabled.onclick = function() {

var optionsTrigger = optionsMenuDom.querySelector('.jasmine-trigger'),
const optionsTrigger = optionsMenuDom.querySelector('.jasmine-trigger'),
optionsPayload = optionsMenuDom.querySelector('.jasmine-payload'),

@@ -649,3 +709,3 @@ isOpen = /\bjasmine-open\b/;

function failureDescription(result, suite) {
var wrapper = createDom(
const wrapper = createDom(
'div',

@@ -659,3 +719,3 @@ { className: 'jasmine-description' },

);
var suiteLink;
let suiteLink;

@@ -678,3 +738,3 @@ while (suite && suite.parent) {

function suiteHref(suite) {
var els = [];
const els = [];

@@ -695,4 +755,4 @@ while (suite && suite.parent) {

if (result && result.deprecationWarnings) {
for (var i = 0; i < result.deprecationWarnings.length; i++) {
var warning = result.deprecationWarnings[i].message;
for (let i = 0; i < result.deprecationWarnings.length; i++) {
const warning = result.deprecationWarnings[i].message;
deprecationWarnings.push({

@@ -709,4 +769,4 @@ message: warning,

function createExpander(stackTrace) {
var expandLink = createDom('a', { href: '#' }, 'Show stack trace');
var root = createDom(
const expandLink = createDom('a', { href: '#' }, 'Show stack trace');
const root = createDom(
'div',

@@ -742,4 +802,3 @@ { className: 'jasmine-expander' },

function clearPrior() {
// return the reporter
var oldReporter = find('');
const oldReporter = find('');

@@ -752,5 +811,4 @@ if (oldReporter) {

function createDom(type, attrs, childrenArrayOrVarArgs) {
var el = createElement(type),
children,
i;
const el = createElement(type);
let children;

@@ -762,3 +820,3 @@ if (j$.isArray_(childrenArrayOrVarArgs)) {

for (i = 2; i < arguments.length; i++) {
for (let i = 2; i < arguments.length; i++) {
children.push(arguments[i]);

@@ -768,4 +826,4 @@ }

for (i = 0; i < children.length; i++) {
var child = children[i];
for (let i = 0; i < children.length; i++) {
const child = children[i];

@@ -781,3 +839,3 @@ if (typeof child === 'string') {

for (var attr in attrs) {
for (const attr in attrs) {
if (attr == 'className') {

@@ -794,3 +852,3 @@ el[attr] = attrs[attr];

function pluralize(singular, count) {
var word = count == 1 ? singular : singular + 's';
const word = count == 1 ? singular : singular + 's';

@@ -825,3 +883,3 @@ return '' + count + ' ' + word;

function noExpectations(result) {
var allExpectations =
const allExpectations =
result.failedExpectations.length + result.passedExpectations.length;

@@ -841,3 +899,3 @@

if (resultNode.type == 'suite') {
for (var i = 0, j = resultNode.children.length; i < j; i++) {
for (let i = 0, j = resultNode.children.length; i < j; i++) {
if (hasActiveSpec(resultNode.children[i])) {

@@ -856,7 +914,7 @@ return true;

function HtmlSpecFilter(options) {
var filterString =
const filterString =
options &&
options.filterString() &&
options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
var filterPattern = new RegExp(filterString);
const filterPattern = new RegExp(filterString);

@@ -905,3 +963,3 @@ this.matches = function(specName) {

this.fullStringWithNewParam = function(key, value) {
var paramMap = queryStringToParamMap();
const paramMap = queryStringToParamMap();
paramMap[key] = value;

@@ -918,4 +976,4 @@ return toQueryString(paramMap);

function toQueryString(paramMap) {
var qStrPairs = [];
for (var prop in paramMap) {
const qStrPairs = [];
for (const prop in paramMap) {
qStrPairs.push(

@@ -929,11 +987,11 @@ encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop])

function queryStringToParamMap() {
var paramStr = options.getWindowLocation().search.substring(1),
params = [],
paramMap = {};
const paramStr = options.getWindowLocation().search.substring(1);
let params = [];
const paramMap = {};
if (paramStr.length > 0) {
params = paramStr.split('&');
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
var value = decodeURIComponent(p[1]);
for (let i = 0; i < params.length; i++) {
const p = params[i].split('=');
let value = decodeURIComponent(p[1]);
if (value === 'true' || value === 'false') {

@@ -940,0 +998,0 @@ value = JSON.parse(value);

/*
Copyright (c) 2008-2022 Pivotal Labs
Copyright (c) 2008-2023 Pivotal Labs

@@ -24,7 +24,7 @@ Permission is hereby granted, free of charge, to any person obtaining

module.exports = function(jasmineRequire) {
var jasmine = jasmineRequire.core(jasmineRequire);
const jasmine = jasmineRequire.core(jasmineRequire);
var env = jasmine.getEnv({suppressLoadErrors: true});
const env = jasmine.getEnv({ suppressLoadErrors: true });
var jasmineInterface = jasmineRequire.interface(jasmine, env);
const jasmineInterface = jasmineRequire.interface(jasmine, env);

@@ -34,3 +34,3 @@ extend(global, jasmineInterface);

function extend(destination, source) {
for (var property in source) destination[property] = source[property];
for (const property in source) destination[property] = source[property];
return destination;

@@ -37,0 +37,0 @@ }

{
"name": "jasmine-core",
"license": "MIT",
"version": "3.99.1",
"version": "4.6.0",
"repository": {

@@ -37,18 +37,17 @@ "type": "git",

"devDependencies": {
"ejs": "^2.5.5",
"eslint": "^6.8.0",
"eslint-plugin-compat": "^3.8.0",
"fast-glob": "^2.2.6",
"grunt": "^1.0.4",
"eslint": "^7.32.0",
"eslint-plugin-compat": ">=4.0.0 <4.1.0",
"glob": "^7.2.0",
"grunt": ">=1.0.4 <1.6.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-compress": "^1.3.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-compress": "^2.0.0",
"grunt-contrib-concat": "^2.0.0",
"grunt-css-url-embed": "^1.11.1",
"grunt-sass": "^3.0.2",
"jasmine": "^3.10.0",
"jasmine-browser-runner": "^0.10.0",
"jsdom": "^15.0.0",
"load-grunt-tasks": "^4.0.0",
"jasmine": "^4.1.0",
"jasmine-browser-runner": "^1.0.0",
"jsdom": "^19.0.0",
"load-grunt-tasks": "^5.1.0",
"prettier": "1.17.1",
"sass": "^1.32.12",
"sass": "1.58.3",
"shelljs": "^0.8.3",

@@ -64,4 +63,9 @@ "temp": "^0.9.0"

],
"env": {
"browser": true,
"node": true,
"es2017": true
},
"parserOptions": {
"ecmaVersion": 5
"ecmaVersion": 2018
},

@@ -82,2 +86,3 @@ "rules": {

],
"no-implicit-globals": "error",
"block-spacing": "error",

@@ -96,13 +101,14 @@ "func-call-spacing": [

],
"space-before-blocks": "error"
"space-before-blocks": "error",
"no-eval": "error",
"no-var": "error"
}
},
"browserslist": [
"Safari >= 8",
"Safari >= 14",
"last 2 Chrome versions",
"last 2 Firefox versions",
"Firefox 68",
"last 2 Edge versions",
"IE >= 10"
"Firefox >= 91",
"last 2 Edge versions"
]
}

@@ -5,3 +5,2 @@ <a name="README">[<img src="https://rawgithub.com/jasmine/jasmine/main/images/jasmine-horizontal.svg" width="400px" />](http://jasmine.github.io)</a>

[![Open Source Helpers](https://www.codetriage.com/jasmine/jasmine/badges/users.svg)](https://www.codetriage.com/jasmine/jasmine)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine?ref=badge_shield)

@@ -12,4 +11,3 @@ # A JavaScript Testing Framework

Documentation & guides live here: [http://jasmine.github.io](http://jasmine.github.io/)
For a quick start guide of Jasmine, see the beginning of [http://jasmine.github.io/edge/introduction.html](http://jasmine.github.io/edge/introduction.html).
Upgrading from Jasmine 3.x? Check out the [upgrade guide](https://jasmine.github.io/tutorials/upgrading_to_Jasmine_4.0).

@@ -22,42 +20,24 @@ ## Contributing

For the Jasmine NPM module:<br>
[https://github.com/jasmine/jasmine-npm](https://github.com/jasmine/jasmine-npm).
There are several different ways to install Jasmine, depending on your
environment and how you'd like to use it. See the [Getting Started page](https://jasmine.github.io/pages/getting_started.html)
for details.
For the Jasmine browser runner:<br>
[https://github.com/jasmine/jasmine-browser](https://github.com/jasmine/jasmine-browser).
## Usage
For the Jasmine Ruby Gem:<br>
[https://github.com/jasmine/jasmine-gem](https://github.com/jasmine/jasmine-gem).
See the [documentation site](https://jasmine.github.io/pages/docs_home.html),
particularly the [Your First Suite tutorial](https://jasmine.github.io/tutorials/your_first_suite)
for information on writing specs, and [the FAQ](https://jasmine.github.io/pages/faq.html).
To install Jasmine standalone on your local box (where **_{#.#.#}_** below is substituted by the release number downloaded):
* Download the standalone distribution for your desired release from the [releases page](https://github.com/jasmine/jasmine/releases).
* Create a Jasmine directory in your project. - `mkdir my-project/jasmine`
* Move the dist to your project directory. - `mv jasmine/dist/jasmine-standalone-{#.#.#}.zip my-project/jasmine`
* Change directory. - `cd my-project/jasmine`
* Unzip the dist. - `unzip jasmine-standalone-{#.#.#}.zip`
Add the following to your HTML file:
```html
<link rel="shortcut icon" type="image/png" href="lib/jasmine-{#.#.#}/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine-{#.#.#}/jasmine.css">
<script type="text/javascript" src="lib/jasmine-{#.#.#}/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-{#.#.#}/jasmine-html.js"></script>
<script type="text/javascript" src="lib/jasmine-{#.#.#}/boot.js"></script>
```
## Supported environments
Jasmine tests itself across many browsers (Safari, Chrome, Firefox, Microsoft Edge, and Internet Explorer) as well as nodejs.
Jasmine tests itself across popular browsers (Safari, Chrome, Firefox, and
Microsoft Edge) as well as Node.
| Environment | Supported versions |
|-------------------|--------------------|
| Node | 10, 12, 14, 16 |
| Safari | 8-14 |
| Node | 12.17+, 14, 16, 18 |
| Safari | 14-16 |
| Chrome | Evergreen |
| Firefox | Evergreen, 68, 78, 91 |
| Firefox | Evergreen, 91, 102 |
| Edge | Evergreen |
| Internet Explorer | 10, 11 |

@@ -68,26 +48,18 @@ For evergreen browsers, each version of Jasmine is tested against the version of the browser that is available to us

## Support
To find out what environments work with a particular Jasmine release, see the [release notes](https://github.com/jasmine/jasmine/tree/main/release_notes).
* Search past discussions: [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js).
* Send an email to the list: [jasmine-js@googlegroups.com](mailto:jasmine-js@googlegroups.com).
* View the project backlog at Pivotal Tracker: [http://www.pivotaltracker.com/projects/10606](http://www.pivotaltracker.com/projects/10606).
* Follow us on Twitter: [@JasmineBDD](http://twitter.com/JasmineBDD).
## Maintainers
* [Gregg Van Hove](mailto:gvanhove@pivotal.io), Pivotal Labs
* [Gwendolyn Van Hove](mailto:gwen@slackersoft.net)
* [Steve Gravrock](mailto:sdg@panix.com)
### Maintainers Emeritus
* [Davis W. Frank](mailto:dwfrank@pivotal.io), Pivotal Labs
* [Rajan Agaskar](mailto:rajan@pivotal.io), Pivotal Labs
* [Greg Cobb](mailto:gcobb@pivotal.io), Pivotal Labs
* [Chris Amavisca](mailto:camavisca@pivotal.io), Pivotal Labs
* [Christian Williams](mailto:antixian666@gmail.com), Cloud Foundry
* [Davis W. Frank](mailto:dwfrank@pivotal.io)
* [Rajan Agaskar](mailto:rajan@pivotal.io)
* [Greg Cobb](mailto:gcobb@pivotal.io)
* [Chris Amavisca](mailto:camavisca@pivotal.io)
* [Christian Williams](mailto:antixian666@gmail.com)
* Sheel Choksi
Copyright (c) 2008-2018 Pivotal Labs. This software is licensed under the MIT License.
## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine?ref=badge_large)
Copyright (c) 2008-2022 Jasmine Maintainers. This software is licensed under the [MIT License](https://github.com/jasmine/jasmine/blob/main/MIT.LICENSE).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc