diff --git a/lib/jasmine-core.js b/lib/jasmine-core.js index e20680c4..30b95b2e 100644 --- a/lib/jasmine-core.js +++ b/lib/jasmine-core.js @@ -6,7 +6,7 @@ const jasmineRequire = require('./jasmine-core/jasmine.js'); module.exports = jasmineRequire; -const boot = (function() { +const bootWithoutGlobals = (function() { let jasmine, jasmineInterface; return function bootWithoutGlobals(reinitialize) { @@ -22,14 +22,16 @@ const boot = (function() { /** * 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 - * unless true is passed. - * @param {boolean} [reinitialize=false] Whether to create a new copy of Jasmine if one already exists + * @param {boolean} [reinitialize=true] Whether to create a new copy of Jasmine if one already exists * @type {function} * @return {jasmine} */ module.exports.boot = function(reinitialize) { - const {jasmine, jasmineInterface} = boot(reinitialize); + if (reinitialize === undefined) { + reinitialize = true; + } + + const {jasmine, jasmineInterface} = bootWithoutGlobals(reinitialize); for (const k in jasmineInterface) { global[k] = jasmineInterface[k]; @@ -48,7 +50,7 @@ module.exports.boot = function(reinitialize) { * const {describe, beforeEach, it, expect, jasmine} = require('jasmine-core').noGlobals(); */ module.exports.noGlobals = function(reinitialize) { - const {jasmineInterface} = boot(reinitialize); + const {jasmineInterface} = bootWithoutGlobals(reinitialize); return jasmineInterface; };