jasmine-core
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -9,7 +9,7 @@ /** | ||
const bootOnce = (function() { | ||
const boot = (function() { | ||
let jasmine, jasmineInterface; | ||
return function bootWithoutGlobals() { | ||
if (!jasmineInterface) { | ||
return function bootWithoutGlobals(reinitialize) { | ||
if (!jasmineInterface || reinitialize === true) { | ||
jasmine = jasmineRequire.core(jasmineRequire); | ||
@@ -26,8 +26,10 @@ const env = jasmine.getEnv({ suppressLoadErrors: true }); | ||
* Boots a copy of Jasmine and returns an object as described in {@link jasmine}. | ||
* If boot is called multiple times, the same object is returned every time. | ||
* If boot is called multiple times, the same object is returned every time | ||
* unless true is passed. | ||
* @param {boolean} [reinitialize=false] Whether to create a new copy of Jasmine if one already exists | ||
* @type {function} | ||
* @return {jasmine} | ||
*/ | ||
module.exports.boot = function() { | ||
const {jasmine, jasmineInterface} = bootOnce(); | ||
module.exports.boot = function(reinitialize) { | ||
const {jasmine, jasmineInterface} = boot(reinitialize); | ||
@@ -44,9 +46,10 @@ for (const k in jasmineInterface) { | ||
* that would normally be added to the global object. If noGlobals is called | ||
* multiple times, the same object is returned every time. | ||
* multiple times, the same object is returned every time unless true is passed. | ||
* | ||
* @param {boolean} [reinitialize=false] Whether to create a new copy of Jasmine if one already exists | ||
* @example | ||
* const {describe, beforeEach, it, expect, jasmine} = require('jasmine-core').noGlobals(); | ||
*/ | ||
module.exports.noGlobals = function() { | ||
const {jasmineInterface} = bootOnce(); | ||
module.exports.noGlobals = function(reinitialize) { | ||
const {jasmineInterface} = boot(reinitialize); | ||
return jasmineInterface; | ||
@@ -53,0 +56,0 @@ }; |
{ | ||
"name": "jasmine-core", | ||
"license": "MIT", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"repository": { | ||
@@ -46,4 +46,4 @@ "type": "git", | ||
"grunt-sass": "^3.0.2", | ||
"jasmine": "5.0.0-beta.0", | ||
"jasmine-browser-runner": "^1.0.0", | ||
"jasmine": "^5.0.0", | ||
"jasmine-browser-runner": "^2.0.0", | ||
"jsdom": "^22.0.0", | ||
@@ -50,0 +50,0 @@ "load-grunt-tasks": "^5.1.0", |
Sorry, the diff of this file is too big to display
388207
10949