');
});
it('should stringify non-empty HTML elements as tags with placeholders', function() {
- const pp = jasmineUnderTest.makePrettyPrinter();
+ const pp = privateUnderTest.makePrettyPrinter();
const nonEmpty = document.createElement('div');
nonEmpty.className = 'foo';
nonEmpty.innerHTML = '
Irrelevant
';
@@ -23,7 +23,7 @@ describe('PrettyPrinter (HTML Dependent)', function() {
it("should print Firefox's wrapped native objects correctly", function() {
if (specHelpers.firefoxVersion) {
- const pp = jasmineUnderTest.makePrettyPrinter();
+ const pp = privateUnderTest.makePrettyPrinter();
let err;
try {
new CustomEvent();
@@ -38,7 +38,7 @@ describe('PrettyPrinter (HTML Dependent)', function() {
});
it('should stringify HTML element with text and attributes', function() {
- const pp = jasmineUnderTest.makePrettyPrinter();
+ const pp = privateUnderTest.makePrettyPrinter();
const el = document.createElement('div');
el.setAttribute('things', 'foo');
el.innerHTML = 'foo';
diff --git a/spec/html/ResultsNodeSpec.js b/spec/html/ResultsNodeSpec.js
index 1869c4a4..f4474d69 100644
--- a/spec/html/ResultsNodeSpec.js
+++ b/spec/html/ResultsNodeSpec.js
@@ -4,7 +4,7 @@ describe('ResultsNode', function() {
id: 123,
message: 'foo'
},
- node = new jasmineUnderTest.ResultsNode(fakeResult, 'suite', null);
+ node = new privateUnderTest.ResultsNode(fakeResult, 'suite', null);
expect(node.result).toBe(fakeResult);
expect(node.type).toEqual('suite');
@@ -19,7 +19,7 @@ describe('ResultsNode', function() {
id: 456,
message: 'bar'
},
- node = new jasmineUnderTest.ResultsNode(fakeResult, 'suite', null);
+ node = new privateUnderTest.ResultsNode(fakeResult, 'suite', null);
node.addChild(fakeChildResult, 'spec');
@@ -37,7 +37,7 @@ describe('ResultsNode', function() {
id: 456,
message: 'bar'
},
- node = new jasmineUnderTest.ResultsNode(fakeResult, 'suite', null);
+ node = new privateUnderTest.ResultsNode(fakeResult, 'suite', null);
node.addChild(fakeChildResult, 'spec');
@@ -53,7 +53,7 @@ describe('ResultsNode', function() {
id: 456,
message: 'bar'
},
- node = new jasmineUnderTest.ResultsNode(fakeResult, 'suite', null);
+ node = new privateUnderTest.ResultsNode(fakeResult, 'suite', null);
node.addChild(fakeChildResult, 'spec');
diff --git a/spec/html/SpyRegistryHtmlSpec.js b/spec/html/SpyRegistryHtmlSpec.js
index 3298fedc..5347a6d1 100644
--- a/spec/html/SpyRegistryHtmlSpec.js
+++ b/spec/html/SpyRegistryHtmlSpec.js
@@ -1,11 +1,11 @@
describe('Spy Registry browser-specific behavior', function() {
function createSpy(name, originalFn) {
- return jasmineUnderTest.Spy(name, originalFn);
+ return privateUnderTest.Spy(name, originalFn);
}
it('can spy on and unspy window.onerror', function() {
const spies = [],
- spyRegistry = new jasmineUnderTest.SpyRegistry({
+ spyRegistry = new privateUnderTest.SpyRegistry({
currentSpies: function() {
return spies;
},
diff --git a/src/core/CallTracker.js b/src/core/CallTracker.js
index ac5f0763..403eaef4 100644
--- a/src/core/CallTracker.js
+++ b/src/core/CallTracker.js
@@ -123,7 +123,9 @@ getJasmineRequireObj().CallTracker = function(j$) {
* @param {Function} [argsCloner] A function to use to clone the arguments. Defaults to a shallow cloning function.
* @function
*/
- this.saveArgumentsByValue = function(argsCloner = j$.util.cloneArgs) {
+ this.saveArgumentsByValue = function(
+ argsCloner = j$.private.util.cloneArgs
+ ) {
opts.cloneArgs = true;
opts.argsCloner = argsCloner;
};
diff --git a/src/core/Deprecator.js b/src/core/Deprecator.js
index 5d4e1f57..e4bff4e9 100644
--- a/src/core/Deprecator.js
+++ b/src/core/Deprecator.js
@@ -23,7 +23,7 @@ getJasmineRequireObj().Deprecator = function(j$) {
) {
options = options || {};
- if (!this.verbose_ && !j$.isError_(deprecation)) {
+ if (!this.verbose_ && !j$.private.isError(deprecation)) {
if (this.toSuppress_.indexOf(deprecation) !== -1) {
return;
}
@@ -35,7 +35,7 @@ getJasmineRequireObj().Deprecator = function(j$) {
};
Deprecator.prototype.log_ = function(runnable, deprecation, options) {
- if (j$.isError_(deprecation)) {
+ if (j$.private.isError(deprecation)) {
// eslint-disable-next-line no-console
console.error(deprecation);
return;
@@ -64,7 +64,7 @@ getJasmineRequireObj().Deprecator = function(j$) {
};
Deprecator.prototype.stackTrace_ = function() {
- const formatter = new j$.ExceptionFormatter();
+ const formatter = new j$.private.ExceptionFormatter();
return formatter.stack(new Error()).replace(/^Error\n/m, '');
};
@@ -73,7 +73,7 @@ getJasmineRequireObj().Deprecator = function(j$) {
runnable = this.topSuite_;
}
- if (j$.isError_(deprecation)) {
+ if (j$.private.isError(deprecation)) {
runnable.addDeprecationWarning(deprecation);
return;
}
diff --git a/src/core/Env.js b/src/core/Env.js
index 7cbc61fd..cf33696a 100644
--- a/src/core/Env.js
+++ b/src/core/Env.js
@@ -11,18 +11,18 @@ getJasmineRequireObj().Env = function(j$) {
envOptions = envOptions || {};
const self = this;
- const GlobalErrors = envOptions.GlobalErrors || j$.GlobalErrors;
+ const GlobalErrors = envOptions.GlobalErrors || j$.private.GlobalErrors;
const global = envOptions.global || j$.getGlobal();
const realSetTimeout = global.setTimeout;
const realClearTimeout = global.clearTimeout;
- const clearStack = j$.getClearStack(global);
- this.clock = new j$.Clock(
+ const clearStack = j$.private.getClearStack(global);
+ this.clock = new j$.private.Clock(
global,
function() {
- return new j$.DelayedFunctionScheduler();
+ return new j$.private.DelayedFunctionScheduler();
},
- new j$.MockDate(global)
+ new j$.private.MockDate(global)
);
const globalErrors = new GlobalErrors(
@@ -50,7 +50,7 @@ getJasmineRequireObj().Env = function(j$) {
};
})();
- const runableResources = new j$.RunableResources({
+ const runableResources = new j$.private.RunableResources({
getCurrentRunableId: function() {
const r = runner.currentRunable();
return r ? r.id : null;
@@ -63,7 +63,7 @@ getJasmineRequireObj().Env = function(j$) {
let runner;
let parallelLoadingState = null; // 'specs', 'helpers', or null for non-parallel
- const config = new j$.Configuration();
+ const config = new j$.private.Configuration();
if (!envOptions.suppressLoadErrors) {
installGlobalErrors();
@@ -132,11 +132,11 @@ getJasmineRequireObj().Env = function(j$) {
runableResources.customObjectFormatters().push(formatter);
};
- j$.Expectation.addCoreMatchers(j$.matchers);
- j$.Expectation.addAsyncCoreMatchers(j$.asyncMatchers);
+ j$.private.Expectation.addCoreMatchers(j$.private.matchers);
+ j$.private.Expectation.addAsyncCoreMatchers(j$.private.asyncMatchers);
const expectationFactory = function(actual, spec) {
- return j$.Expectation.factory({
+ return j$.private.Expectation.factory({
matchersUtil: runableResources.makeMatchersUtil(),
customMatchers: runableResources.customMatchers(),
actual: actual,
@@ -169,7 +169,7 @@ getJasmineRequireObj().Env = function(j$) {
};
const throwUnlessFactory = function(actual, spec) {
- return j$.Expectation.factory({
+ return j$.private.Expectation.factory({
matchersUtil: runableResources.makeMatchersUtil(),
customMatchers: runableResources.customMatchers(),
actual: actual,
@@ -178,7 +178,7 @@ getJasmineRequireObj().Env = function(j$) {
};
const throwUnlessAsyncFactory = function(actual, spec) {
- return j$.Expectation.asyncFactory({
+ return j$.private.Expectation.asyncFactory({
matchersUtil: runableResources.makeMatchersUtil(),
customAsyncMatchers: runableResources.customAsyncMatchers(),
actual: actual,
@@ -193,7 +193,7 @@ getJasmineRequireObj().Env = function(j$) {
error.matcherName !== undefined && error.passed !== undefined;
const result = isExpectationResult
? error
- : j$.buildExpectationResult({
+ : j$.private.buildExpectationResult({
error,
passed: false,
matcherName: '',
@@ -254,7 +254,7 @@ getJasmineRequireObj().Env = function(j$) {
}
const asyncExpectationFactory = function(actual, spec, runableType) {
- return j$.Expectation.asyncFactory({
+ return j$.private.Expectation.asyncFactory({
matchersUtil: runableResources.makeMatchersUtil(),
customAsyncMatchers: runableResources.customAsyncMatchers(),
actual: actual,
@@ -310,10 +310,10 @@ getJasmineRequireObj().Env = function(j$) {
(runner.currentRunable() || topSuite).handleException(e);
};
- new j$.QueueRunner(options).execute();
+ new j$.private.QueueRunner(options).execute();
}
- const suiteBuilder = new j$.SuiteBuilder({
+ const suiteBuilder = new j$.private.SuiteBuilder({
env: this,
expectationFactory,
asyncExpectationFactory,
@@ -321,7 +321,7 @@ getJasmineRequireObj().Env = function(j$) {
runQueue
});
topSuite = suiteBuilder.topSuite;
- const deprecator = new j$.Deprecator(topSuite);
+ const deprecator = new j$.private.Deprecator(topSuite);
/**
* Provides the root suite, through which all suites and specs can be
@@ -341,23 +341,23 @@ getJasmineRequireObj().Env = function(j$) {
* @interface Reporter
* @see custom_reporter
*/
- reportDispatcher = new j$.ReportDispatcher(
- j$.reporterEvents,
+ reportDispatcher = new j$.private.ReportDispatcher(
+ j$.private.reporterEvents,
function(options) {
- options.SkipPolicy = j$.NeverSkipPolicy;
+ options.SkipPolicy = j$.private.NeverSkipPolicy;
return runQueue(options);
},
recordLateError
);
- runner = new j$.Runner({
+ runner = new j$.private.Runner({
topSuite,
totalSpecsDefined: () => suiteBuilder.totalSpecsDefined,
focusedRunables: () => suiteBuilder.focusedRunables,
runableResources,
reportDispatcher,
runQueue,
- TreeProcessor: j$.TreeProcessor,
+ TreeProcessor: j$.private.TreeProcessor,
globalErrors,
getConfig: () => config
});
@@ -523,7 +523,7 @@ getJasmineRequireObj().Env = function(j$) {
try {
const maybePromise = fn(spy);
- if (!j$.isPromiseLike(maybePromise)) {
+ if (!j$.private.isPromiseLike(maybePromise)) {
throw new Error(
'The callback to spyOnGlobalErrorsAsync must be an async or promise-returning function'
);
@@ -758,7 +758,7 @@ getJasmineRequireObj().Env = function(j$) {
};
this.pending = function(message) {
- let fullMessage = j$.Spec.pendingSpecExceptionMessage;
+ let fullMessage = j$.private.Spec.pendingSpecExceptionMessage;
if (message) {
fullMessage += message;
}
@@ -777,7 +777,7 @@ getJasmineRequireObj().Env = function(j$) {
message += ': ';
if (error.message) {
message += error.message;
- } else if (j$.isString_(error)) {
+ } else if (j$.private.isString(error)) {
message += error;
} else {
// pretty print all kind of objects. This includes arrays.
@@ -806,7 +806,7 @@ getJasmineRequireObj().Env = function(j$) {
}
function callerCallerFilename() {
- const frames = new j$.StackTrace(new Error()).frames;
+ const frames = new j$.private.StackTrace(new Error()).frames;
// frames[3] should always exist except in Jasmine's own tests, which bypass
// the global it/describe layer, but don't crash if it doesn't.
return frames[3] && frames[3].file;
diff --git a/src/core/ExceptionFormatter.js b/src/core/ExceptionFormatter.js
index c2d6710a..cedc76e3 100644
--- a/src/core/ExceptionFormatter.js
+++ b/src/core/ExceptionFormatter.js
@@ -14,7 +14,7 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) {
function ExceptionFormatter(options) {
const jasmineFile =
- (options && options.jasmineFile) || j$.util.jasmineFile();
+ (options && options.jasmineFile) || j$.private.util.jasmineFile();
this.message = function(error) {
let message = '';
@@ -58,7 +58,7 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) {
lines.pop();
}
- const stackTrace = new j$.StackTrace(error);
+ const stackTrace = new j$.private.StackTrace(error);
lines = lines.concat(filterJasmine(stackTrace));
if (messageHandling === 'require') {
@@ -111,7 +111,9 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) {
}
if (!empty) {
- return 'error properties: ' + j$.basicPrettyPrinter_(result) + '\n';
+ return (
+ 'error properties: ' + j$.private.basicPrettyPrinter(result) + '\n'
+ );
}
return '';
diff --git a/src/core/Expectation.js b/src/core/Expectation.js
index 8d3950dc..00360404 100644
--- a/src/core/Expectation.js
+++ b/src/core/Expectation.js
@@ -4,7 +4,7 @@ getJasmineRequireObj().Expectation = function(j$) {
* @namespace matchers
*/
function Expectation(options) {
- this.expector = new j$.Expector(options);
+ this.expector = new j$.private.Expector(options);
const customMatchers = options.customMatchers || {};
for (const matcherName in customMatchers) {
@@ -80,7 +80,7 @@ getJasmineRequireObj().Expectation = function(j$) {
* @namespace async-matchers
*/
function AsyncExpectation(options) {
- this.expector = new j$.Expector(options);
+ this.expector = new j$.private.Expector(options);
const customAsyncMatchers = options.customAsyncMatchers || {};
for (const matcherName in customAsyncMatchers) {
@@ -173,7 +173,7 @@ getJasmineRequireObj().Expectation = function(j$) {
function negatedFailureMessage(result, matcherName, args, matchersUtil) {
if (result.message) {
- if (j$.isFunction_(result.message)) {
+ if (j$.private.isFunction(result.message)) {
return result.message();
} else {
return result.message;
@@ -218,7 +218,7 @@ getJasmineRequireObj().Expectation = function(j$) {
return function(actual) {
const matcherArgs = arguments;
- return j$.isPending_(actual).then(function(isPending) {
+ return j$.private.isPending(actual).then(function(isPending) {
if (isPending) {
return {
pass: false,
diff --git a/src/core/Expector.js b/src/core/Expector.js
index 01802f24..a5ddeabf 100644
--- a/src/core/Expector.js
+++ b/src/core/Expector.js
@@ -5,7 +5,7 @@ getJasmineRequireObj().Expector = function(j$) {
};
this.actual = options.actual;
this.addExpectationResult = options.addExpectationResult || function() {};
- this.filters = new j$.ExpectationFilterChain();
+ this.filters = new j$.private.ExpectationFilterChain();
}
Expector.prototype.instantiateMatcher = function(
@@ -39,7 +39,7 @@ getJasmineRequireObj().Expector = function(j$) {
this.matchersUtil,
args
);
- } else if (j$.isFunction_(result.message)) {
+ } else if (j$.private.isFunction(result.message)) {
return result.message();
} else {
return result.message;
diff --git a/src/core/GlobalErrors.js b/src/core/GlobalErrors.js
index 27af0128..ec167ae5 100644
--- a/src/core/GlobalErrors.js
+++ b/src/core/GlobalErrors.js
@@ -24,7 +24,7 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
if (
global.process &&
global.process.listeners &&
- j$.isFunction_(global.process.on)
+ j$.private.isFunction(global.process.on)
) {
this.#adapter = new NodeAdapter(global, dispatch);
} else {
@@ -173,7 +173,7 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
const jasmineMessage = 'Unhandled promise rejection: ' + event.reason;
let reason;
- if (j$.isError_(event.reason)) {
+ if (j$.private.isError(event.reason)) {
reason = event.reason;
reason.jasmineMessage = jasmineMessage;
} else {
@@ -252,7 +252,7 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
jasmineMessagePrefix = 'Uncaught exception';
}
- if (j$.isError_(error)) {
+ if (j$.private.isError(error)) {
error.jasmineMessage = jasmineMessagePrefix + ': ' + error;
return error;
} else {
diff --git a/src/core/ParallelReportDispatcher.js b/src/core/ParallelReportDispatcher.js
index db673065..c6491d21 100644
--- a/src/core/ParallelReportDispatcher.js
+++ b/src/core/ParallelReportDispatcher.js
@@ -16,11 +16,12 @@ getJasmineRequireObj().ParallelReportDispatcher = function(j$) {
* @param onError {function} Function called when an unhandled exception, unhandled promise rejection, or explicit reporter failure occurs
*/
function ParallelReportDispatcher(onError, deps = {}) {
- const ReportDispatcher = deps.ReportDispatcher || j$.ReportDispatcher;
- const QueueRunner = deps.QueueRunner || j$.QueueRunner;
- const globalErrors = deps.globalErrors || new j$.GlobalErrors();
+ const ReportDispatcher =
+ deps.ReportDispatcher || j$.private.ReportDispatcher;
+ const QueueRunner = deps.QueueRunner || j$.private.QueueRunner;
+ const globalErrors = deps.globalErrors || new j$.private.GlobalErrors();
const dispatcher = new ReportDispatcher(
- j$.reporterEvents,
+ j$.private.reporterEvents,
function(queueRunnerOptions) {
queueRunnerOptions = {
...queueRunnerOptions,
@@ -84,7 +85,7 @@ getJasmineRequireObj().ParallelReportDispatcher = function(j$) {
}
};
- for (const eventName of j$.reporterEvents) {
+ for (const eventName of j$.private.reporterEvents) {
self[eventName] = dispatcher[eventName].bind(dispatcher);
}
diff --git a/src/core/PrettyPrinter.js b/src/core/PrettyPrinter.js
index 5489f910..7ee38566 100644
--- a/src/core/PrettyPrinter.js
+++ b/src/core/PrettyPrinter.js
@@ -26,7 +26,7 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
this.emitScalar('
');
} else if (value.jasmineToString) {
this.emitScalar(value.jasmineToString(this.pp_));
- } else if (j$.isString_(value)) {
+ } else if (j$.private.isString(value)) {
this.emitString(value);
} else if (j$.isSpy(value)) {
this.emitScalar('spy on ' + value.and.identity);
@@ -40,7 +40,7 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
} else {
this.emitScalar('Function');
}
- } else if (j$.isDomNode(value)) {
+ } else if (j$.private.isDomNode(value)) {
if (value.tagName) {
this.emitDomElement(value);
} else {
@@ -48,16 +48,16 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
}
} else if (value instanceof Date) {
this.emitScalar('Date(' + value + ')');
- } else if (j$.isSet(value)) {
+ } else if (j$.private.isSet(value)) {
this.emitSet(value);
- } else if (j$.isMap(value)) {
+ } else if (j$.private.isMap(value)) {
this.emitMap(value);
- } else if (j$.isTypedArray_(value)) {
+ } else if (j$.private.isTypedArray(value)) {
this.emitTypedArray(value);
} else if (
value.toString &&
typeof value === 'object' &&
- !j$.isArray_(value) &&
+ !j$.private.isArray(value) &&
hasCustomToString(value)
) {
try {
@@ -69,12 +69,15 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
} else if (this.seen.includes(value)) {
this.emitScalar(
''
);
- } else if (j$.isArray_(value) || j$.isA_('Object', value)) {
+ } else if (
+ j$.private.isArray(value) ||
+ j$.private.isA('Object', value)
+ ) {
this.seen.push(value);
- if (j$.isArray_(value)) {
+ if (j$.private.isArray(value)) {
this.emitArray(value);
} else {
this.emitObject(value);
@@ -97,7 +100,10 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
}
iterateObject(obj, fn) {
- const objKeys = j$.MatchersUtil.keys(obj, j$.isArray_(obj));
+ const objKeys = j$.private.MatchersUtil.keys(
+ obj,
+ j$.private.isArray(obj)
+ );
const length = Math.min(objKeys.length, j$.MAX_PRETTY_PRINT_ARRAY_LENGTH);
for (let i = 0; i < length; i++) {
@@ -206,7 +212,7 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
const ctor = obj.constructor;
const constructorName =
typeof ctor === 'function' && obj instanceof ctor
- ? j$.fnNameFor(obj.constructor)
+ ? j$.private.fnNameFor(obj.constructor)
: 'null';
this.append(constructorName);
@@ -236,7 +242,7 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
}
emitTypedArray(arr) {
- const constructorName = j$.fnNameFor(arr.constructor);
+ const constructorName = j$.private.fnNameFor(arr.constructor);
const limitedArray = Array.prototype.slice.call(
arr,
0,
@@ -305,7 +311,7 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
// iframe, web worker)
try {
return (
- j$.isFunction_(value.toString) &&
+ j$.private.isFunction(value.toString) &&
value.toString !== Object.prototype.toString &&
value.toString() !== Object.prototype.toString.call(value)
);
diff --git a/src/core/QueueRunner.js b/src/core/QueueRunner.js
index 87d3ee10..5a339157 100644
--- a/src/core/QueueRunner.js
+++ b/src/core/QueueRunner.js
@@ -3,7 +3,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
function StopExecutionError() {}
StopExecutionError.prototype = new Error();
- j$.StopExecutionError = StopExecutionError;
+ j$.private.StopExecutionError = StopExecutionError;
function once(fn, onTwice) {
let called = false;
@@ -56,7 +56,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
};
this.onException = attrs.onException || emptyFn;
this.onMultipleDone = attrs.onMultipleDone || fallbackOnMultipleDone;
- this.userContext = attrs.userContext || new j$.UserContext();
+ this.userContext = attrs.userContext || new j$.private.UserContext();
this.timeout = attrs.timeout || {
setTimeout: setTimeout,
clearTimeout: clearTimeout
@@ -67,7 +67,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
popListener: emptyFn
};
- const SkipPolicy = attrs.SkipPolicy || j$.NeverSkipPolicy;
+ const SkipPolicy = attrs.SkipPolicy || j$.private.NeverSkipPolicy;
this.skipPolicy_ = new SkipPolicy(this.queueableFns);
this.errored_ = false;
@@ -190,7 +190,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
if (queueableFn.fn.length === 0) {
maybeThenable = queueableFn.fn.call(this.userContext);
- if (maybeThenable && j$.isFunction_(maybeThenable.then)) {
+ if (maybeThenable && j$.private.isFunction(maybeThenable.then)) {
maybeThenable.then(
wrapInPromiseResolutionHandler(next),
onPromiseRejection
@@ -260,11 +260,11 @@ getJasmineRequireObj().QueueRunner = function(j$) {
};
QueueRunner.prototype.diagnoseConflictingAsync_ = function(fn, retval) {
- if (retval && j$.isFunction_(retval.then)) {
+ if (retval && j$.private.isFunction(retval.then)) {
// Issue a warning that matches the user's code.
// Omit the stack trace because there's almost certainly no user code
// on the stack at this point.
- if (j$.isAsyncFunction_(fn)) {
+ if (j$.private.isAsyncFunction(fn)) {
this.onException(
new Error(
'An asynchronous before/it/after ' +
@@ -288,7 +288,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
function wrapInPromiseResolutionHandler(fn) {
return function(maybeArg) {
- if (j$.isError_(maybeArg)) {
+ if (j$.private.isError(maybeArg)) {
fn(maybeArg);
} else {
fn();
diff --git a/src/core/RunableResources.js b/src/core/RunableResources.js
index 33e8b025..ae1ce6a8 100644
--- a/src/core/RunableResources.js
+++ b/src/core/RunableResources.js
@@ -5,7 +5,7 @@ getJasmineRequireObj().RunableResources = function(j$) {
this.getCurrentRunableId_ = options.getCurrentRunableId;
this.globalErrors_ = options.globalErrors;
- this.spyFactory = new j$.SpyFactory(
+ this.spyFactory = new j$.private.SpyFactory(
() => {
if (this.getCurrentRunableId_()) {
return this.customSpyStrategies();
@@ -17,7 +17,7 @@ getJasmineRequireObj().RunableResources = function(j$) {
() => this.makeMatchersUtil()
);
- this.spyRegistry = new j$.SpyRegistry({
+ this.spyRegistry = new j$.private.SpyRegistry({
currentSpies: () => this.spies(),
createSpy: (name, originalFn) =>
this.spyFactory.createSpy(name, originalFn)
@@ -48,7 +48,7 @@ getJasmineRequireObj().RunableResources = function(j$) {
];
for (const k of toClone) {
- newRes[k] = j$.util.clone(parentRes[k]);
+ newRes[k] = j$.private.util.clone(parentRes[k]);
}
}
}
@@ -126,17 +126,19 @@ getJasmineRequireObj().RunableResources = function(j$) {
}
makePrettyPrinter() {
- return j$.makePrettyPrinter(this.customObjectFormatters());
+ return j$.private.makePrettyPrinter(this.customObjectFormatters());
}
makeMatchersUtil() {
if (this.getCurrentRunableId_()) {
- return new j$.MatchersUtil({
+ return new j$.private.MatchersUtil({
customTesters: this.customEqualityTesters(),
pp: this.makePrettyPrinter()
});
} else {
- return new j$.MatchersUtil({ pp: j$.basicPrettyPrinter_ });
+ return new j$.private.MatchersUtil({
+ pp: j$.private.basicPrettyPrinter
+ });
}
}
diff --git a/src/core/Runner.js b/src/core/Runner.js
index 8e06e8b6..9c71d7e5 100644
--- a/src/core/Runner.js
+++ b/src/core/Runner.js
@@ -24,7 +24,7 @@ getJasmineRequireObj().Runner = function(j$) {
this.#reportDispatcher = options.reportDispatcher;
this.#getConfig = options.getConfig;
this.#executedBefore = false;
- this.#currentRunableTracker = new j$.CurrentRunableTracker();
+ this.#currentRunableTracker = new j$.private.CurrentRunableTracker();
}
currentSpec() {
@@ -64,9 +64,9 @@ getJasmineRequireObj().Runner = function(j$) {
}
}
- const order = new j$.Order({
+ const order = new j$.private.Order({
random: config.random,
- seed: j$.isNumber_(config.seed) ? config.seed + '' : config.seed
+ seed: j$.private.isNumber(config.seed) ? config.seed + '' : config.seed
});
const treeProcessor = new this.#TreeProcessor({
@@ -108,7 +108,7 @@ getJasmineRequireObj().Runner = function(j$) {
});
this.#currentRunableTracker.pushSuite(this.#topSuite);
- const treeRunner = new j$.TreeRunner({
+ const treeRunner = new j$.private.TreeRunner({
executionTree: this.#executionTree,
globalErrors: this.#globalErrors,
runableResources: this.#runableResources,
diff --git a/src/core/Spec.js b/src/core/Spec.js
index 56d572bf..2f3202d8 100644
--- a/src/core/Spec.js
+++ b/src/core/Spec.js
@@ -43,7 +43,7 @@ getJasmineRequireObj().Spec = function(j$) {
}
addExpectationResult(passed, data, isError) {
- const expectationResult = j$.buildExpectationResult(data);
+ const expectationResult = j$.private.buildExpectationResult(data);
if (passed) {
this.result.passedExpectations.push(expectationResult);
@@ -60,7 +60,7 @@ getJasmineRequireObj().Spec = function(j$) {
}
if (this.#throwOnExpectationFailure && !isError) {
- throw new j$.errors.ExpectationFailed();
+ throw new j$.private.errors.ExpectationFailed();
}
}
}
@@ -74,8 +74,8 @@ getJasmineRequireObj().Spec = function(j$) {
// Key and value will eventually be cloned during reporting. The error
// thrown at that point if they aren't cloneable isn't very helpful.
// Throw a better one now.
- j$.util.assertStructuredCloneable(key, 'Key');
- j$.util.assertStructuredCloneable(value, 'Value');
+ j$.private.util.assertStructuredCloneable(key, 'Key');
+ j$.private.util.assertStructuredCloneable(value, 'Value');
this.result.properties = this.result.properties || {};
this.result.properties[key] = value;
}
@@ -194,7 +194,7 @@ getJasmineRequireObj().Spec = function(j$) {
return;
}
- if (e instanceof j$.errors.ExpectationFailed) {
+ if (e instanceof j$.private.errors.ExpectationFailed) {
return;
}
@@ -264,7 +264,7 @@ getJasmineRequireObj().Spec = function(j$) {
deprecation = { message: deprecation };
}
this.result.deprecationWarnings.push(
- j$.buildExpectationResult(deprecation)
+ j$.private.buildExpectationResult(deprecation)
);
}
diff --git a/src/core/Spy.js b/src/core/Spy.js
index 41180f42..73d7c248 100644
--- a/src/core/Spy.js
+++ b/src/core/Spy.js
@@ -53,7 +53,7 @@ getJasmineRequireObj().Spy = function(j$) {
},
matchersUtil
),
- callTracker = new j$.CallTracker();
+ callTracker = new j$.private.CallTracker();
function makeFunc(length, fn) {
switch (length) {
@@ -145,9 +145,9 @@ getJasmineRequireObj().Spy = function(j$) {
}
function SpyStrategyDispatcher(strategyArgs, matchersUtil) {
- const baseStrategy = new j$.SpyStrategy(strategyArgs);
+ const baseStrategy = new j$.private.SpyStrategy(strategyArgs);
const argsStrategies = new StrategyDict(function() {
- return new j$.SpyStrategy(strategyArgs);
+ return new j$.private.SpyStrategy(strategyArgs);
}, matchersUtil);
this.and = baseStrategy;
diff --git a/src/core/SpyFactory.js b/src/core/SpyFactory.js
index 512a8912..51f89400 100644
--- a/src/core/SpyFactory.js
+++ b/src/core/SpyFactory.js
@@ -5,12 +5,12 @@ getJasmineRequireObj().SpyFactory = function(j$) {
getMatchersUtil
) {
this.createSpy = function(name, originalFn) {
- if (j$.isFunction_(name) && originalFn === undefined) {
+ if (j$.private.isFunction(name) && originalFn === undefined) {
originalFn = name;
name = originalFn.name;
}
- return j$.Spy(name, getMatchersUtil(), {
+ return j$.private.Spy(name, getMatchersUtil(), {
originalFn,
customStrategies: getCustomStrategies(),
defaultStrategyFn: getDefaultStrategyFn()
@@ -19,7 +19,7 @@ getJasmineRequireObj().SpyFactory = function(j$) {
this.createSpyObj = function(baseName, methodNames, propertyNames) {
const baseNameIsCollection =
- j$.isObject_(baseName) || j$.isArray_(baseName);
+ j$.private.isObject(baseName) || j$.private.isArray(baseName);
if (baseNameIsCollection) {
propertyNames = methodNames;
@@ -65,11 +65,11 @@ getJasmineRequireObj().SpyFactory = function(j$) {
function normalizeKeyValues(object) {
const result = [];
- if (j$.isArray_(object)) {
+ if (j$.private.isArray(object)) {
for (let i = 0; i < object.length; i++) {
result.push([object[i]]);
}
- } else if (j$.isObject_(object)) {
+ } else if (j$.private.isObject(object)) {
for (const key in object) {
if (object.hasOwnProperty(key)) {
result.push([key, object[key]]);
diff --git a/src/core/SpyRegistry.js b/src/core/SpyRegistry.js
index b4a246da..b4d06b69 100644
--- a/src/core/SpyRegistry.js
+++ b/src/core/SpyRegistry.js
@@ -1,9 +1,9 @@
getJasmineRequireObj().SpyRegistry = function(j$) {
- const spyOnMsg = j$.formatErrorMsg(
+ const spyOnMsg = j$.private.formatErrorMsg(
'',
'spyOn(