Built distribution
This commit is contained in:
+8
-8
@@ -79,15 +79,15 @@ module.exports.noGlobals = function() {
|
|||||||
return jasmineInterface;
|
return jasmineInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
const path = require('path'),
|
const path = require('path');
|
||||||
fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
const rootPath = path.join(__dirname, 'jasmine-core'),
|
const rootPath = path.join(__dirname, 'jasmine-core');
|
||||||
bootFiles = ['boot0.js', 'boot1.js'],
|
const bootFiles = ['boot0.js', 'boot1.js'];
|
||||||
legacyBootFiles = ['boot.js'],
|
const legacyBootFiles = ['boot.js'];
|
||||||
cssFiles = [],
|
const cssFiles = [];
|
||||||
jsFiles = [],
|
const jsFiles = [];
|
||||||
jsFilesToSkip = ['jasmine.js'].concat(bootFiles, legacyBootFiles);
|
const jsFilesToSkip = ['jasmine.js'].concat(bootFiles, legacyBootFiles);
|
||||||
|
|
||||||
fs.readdirSync(rootPath).forEach(function(file) {
|
fs.readdirSync(rootPath).forEach(function(file) {
|
||||||
if (fs.statSync(path.join(rootPath, file)).isFile()) {
|
if (fs.statSync(path.join(rootPath, file)).isFile()) {
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
*
|
*
|
||||||
* Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
|
* Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
|
||||||
*/
|
*/
|
||||||
const jasmine = jasmineRequire.core(jasmineRequire),
|
const jasmine = jasmineRequire.core(jasmineRequire);
|
||||||
global = jasmine.getGlobal();
|
const global = jasmine.getGlobal();
|
||||||
global.jasmine = jasmine;
|
global.jasmine = jasmine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -707,9 +707,9 @@ jasmineRequire.Banner = function(j$) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const optionsTrigger = optionsMenuDom.querySelector('.jasmine-trigger'),
|
const optionsTrigger = optionsMenuDom.querySelector('.jasmine-trigger');
|
||||||
optionsPayload = optionsMenuDom.querySelector('.jasmine-payload'),
|
const optionsPayload = optionsMenuDom.querySelector('.jasmine-payload');
|
||||||
isOpen = /\bjasmine-open\b/;
|
const isOpen = /\bjasmine-open\b/;
|
||||||
|
|
||||||
optionsTrigger.onclick = function() {
|
optionsTrigger.onclick = function() {
|
||||||
if (isOpen.test(optionsPayload.className)) {
|
if (isOpen.test(optionsPayload.className)) {
|
||||||
|
|||||||
+125
-123
@@ -153,43 +153,43 @@ getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const availableMatchers = [
|
const availableMatchers = [
|
||||||
'nothing',
|
'nothing',
|
||||||
'toBe',
|
'toBe',
|
||||||
'toBeCloseTo',
|
'toBeCloseTo',
|
||||||
'toBeDefined',
|
'toBeDefined',
|
||||||
'toBeInstanceOf',
|
'toBeInstanceOf',
|
||||||
'toBeFalse',
|
'toBeFalse',
|
||||||
'toBeFalsy',
|
'toBeFalsy',
|
||||||
'toBeGreaterThan',
|
'toBeGreaterThan',
|
||||||
'toBeGreaterThanOrEqual',
|
'toBeGreaterThanOrEqual',
|
||||||
'toBeLessThan',
|
'toBeLessThan',
|
||||||
'toBeLessThanOrEqual',
|
'toBeLessThanOrEqual',
|
||||||
'toBeNaN',
|
'toBeNaN',
|
||||||
'toBeNegativeInfinity',
|
'toBeNegativeInfinity',
|
||||||
'toBeNull',
|
'toBeNull',
|
||||||
'toBePositiveInfinity',
|
'toBePositiveInfinity',
|
||||||
'toBeTrue',
|
'toBeTrue',
|
||||||
'toBeTruthy',
|
'toBeTruthy',
|
||||||
'toBeUndefined',
|
'toBeUndefined',
|
||||||
'toBeNullish',
|
'toBeNullish',
|
||||||
'toContain',
|
'toContain',
|
||||||
'toEqual',
|
'toEqual',
|
||||||
'toHaveSize',
|
'toHaveSize',
|
||||||
'toHaveBeenCalled',
|
'toHaveBeenCalled',
|
||||||
'toHaveBeenCalledBefore',
|
'toHaveBeenCalledBefore',
|
||||||
'toHaveBeenCalledOnceWith',
|
'toHaveBeenCalledOnceWith',
|
||||||
'toHaveBeenCalledTimes',
|
'toHaveBeenCalledTimes',
|
||||||
'toHaveBeenCalledWith',
|
'toHaveBeenCalledWith',
|
||||||
'toHaveClass',
|
'toHaveClass',
|
||||||
'toHaveClasses',
|
'toHaveClasses',
|
||||||
'toHaveSpyInteractions',
|
'toHaveSpyInteractions',
|
||||||
'toHaveNoOtherSpyInteractions',
|
'toHaveNoOtherSpyInteractions',
|
||||||
'toMatch',
|
'toMatch',
|
||||||
'toThrow',
|
'toThrow',
|
||||||
'toThrowError',
|
'toThrowError',
|
||||||
'toThrowMatching'
|
'toThrowMatching'
|
||||||
],
|
];
|
||||||
matchers = {};
|
const matchers = {};
|
||||||
|
|
||||||
for (const name of availableMatchers) {
|
for (const name of availableMatchers) {
|
||||||
matchers[name] = jRequire[name](j$);
|
matchers[name] = jRequire[name](j$);
|
||||||
@@ -733,8 +733,8 @@ getJasmineRequireObj().util = function(j$) {
|
|||||||
|
|
||||||
util.cloneArgs = function(args) {
|
util.cloneArgs = function(args) {
|
||||||
return Array.from(args).map(function(arg) {
|
return Array.from(args).map(function(arg) {
|
||||||
const str = Object.prototype.toString.apply(arg),
|
const str = Object.prototype.toString.apply(arg);
|
||||||
primitives = /^\[object (Boolean|String|RegExp|Number)/;
|
const primitives = /^\[object (Boolean|String|RegExp|Number)/;
|
||||||
|
|
||||||
// All falsey values are either primitives, `null`, or `undefined.
|
// All falsey values are either primitives, `null`, or `undefined.
|
||||||
if (!arg || str.match(primitives)) {
|
if (!arg || str.match(primitives)) {
|
||||||
@@ -748,8 +748,8 @@ getJasmineRequireObj().util = function(j$) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
util.getPropertyDescriptor = function(obj, methodName) {
|
util.getPropertyDescriptor = function(obj, methodName) {
|
||||||
let descriptor,
|
let descriptor;
|
||||||
proto = obj;
|
let proto = obj;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
descriptor = Object.getOwnPropertyDescriptor(proto, methodName);
|
descriptor = Object.getOwnPropertyDescriptor(proto, methodName);
|
||||||
@@ -1175,10 +1175,12 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const extractCustomPendingMessage = function(e) {
|
const extractCustomPendingMessage = function(e) {
|
||||||
const fullMessage = e.toString(),
|
const fullMessage = e.toString();
|
||||||
boilerplateStart = fullMessage.indexOf(Spec.pendingSpecExceptionMessage),
|
const boilerplateStart = fullMessage.indexOf(
|
||||||
boilerplateEnd =
|
Spec.pendingSpecExceptionMessage
|
||||||
boilerplateStart + Spec.pendingSpecExceptionMessage.length;
|
);
|
||||||
|
const boilerplateEnd =
|
||||||
|
boilerplateStart + Spec.pendingSpecExceptionMessage.length;
|
||||||
|
|
||||||
return fullMessage.slice(boilerplateEnd);
|
return fullMessage.slice(boilerplateEnd);
|
||||||
};
|
};
|
||||||
@@ -2139,8 +2141,8 @@ getJasmineRequireObj().JsApiReporter = function(j$) {
|
|||||||
return status;
|
return status;
|
||||||
};
|
};
|
||||||
|
|
||||||
const suites = [],
|
const suites = [];
|
||||||
suites_hash = {};
|
const suites_hash = {};
|
||||||
|
|
||||||
this.suiteStarted = function(result) {
|
this.suiteStarted = function(result) {
|
||||||
suites_hash[result.id] = result;
|
suites_hash[result.id] = result;
|
||||||
@@ -5491,14 +5493,14 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MatchersUtil.prototype.buildFailureMessage = function() {
|
MatchersUtil.prototype.buildFailureMessage = function() {
|
||||||
const args = Array.prototype.slice.call(arguments, 0),
|
const args = Array.prototype.slice.call(arguments, 0);
|
||||||
matcherName = args[0],
|
const matcherName = args[0];
|
||||||
isNot = args[1],
|
const isNot = args[1];
|
||||||
actual = args[2],
|
const actual = args[2];
|
||||||
expected = args.slice(3),
|
const expected = args.slice(3);
|
||||||
englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) {
|
const englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) {
|
||||||
return ' ' + s.toLowerCase();
|
return ' ' + s.toLowerCase();
|
||||||
});
|
});
|
||||||
|
|
||||||
let message =
|
let message =
|
||||||
'Expected ' +
|
'Expected ' +
|
||||||
@@ -5880,8 +5882,8 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
|
|||||||
} else {
|
} else {
|
||||||
// Objects with different constructors are not equivalent, but `Object`s
|
// Objects with different constructors are not equivalent, but `Object`s
|
||||||
// or `Array`s from different frames are.
|
// or `Array`s from different frames are.
|
||||||
const aCtor = a.constructor,
|
const aCtor = a.constructor;
|
||||||
bCtor = b.constructor;
|
const bCtor = b.constructor;
|
||||||
if (
|
if (
|
||||||
aCtor !== bCtor &&
|
aCtor !== bCtor &&
|
||||||
isFunction(aCtor) &&
|
isFunction(aCtor) &&
|
||||||
@@ -5987,11 +5989,11 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function objectKeysAreDifferentFormatter(pp, actual, expected, path) {
|
function objectKeysAreDifferentFormatter(pp, actual, expected, path) {
|
||||||
const missingProperties = extraKeysAndValues(expected, actual),
|
const missingProperties = extraKeysAndValues(expected, actual);
|
||||||
extraProperties = extraKeysAndValues(actual, expected),
|
const extraProperties = extraKeysAndValues(actual, expected);
|
||||||
missingPropertiesMessage = formatKeyValuePairs(pp, missingProperties),
|
const missingPropertiesMessage = formatKeyValuePairs(pp, missingProperties);
|
||||||
extraPropertiesMessage = formatKeyValuePairs(pp, extraProperties),
|
const extraPropertiesMessage = formatKeyValuePairs(pp, extraProperties);
|
||||||
messages = [];
|
const messages = [];
|
||||||
|
|
||||||
if (!path.depth()) {
|
if (!path.depth()) {
|
||||||
path = 'object';
|
path = 'object';
|
||||||
@@ -6249,15 +6251,15 @@ getJasmineRequireObj().requireAsyncMatchers = function(jRequire, j$) {
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const availableMatchers = [
|
const availableMatchers = [
|
||||||
'toBePending',
|
'toBePending',
|
||||||
'toBeResolved',
|
'toBeResolved',
|
||||||
'toBeRejected',
|
'toBeRejected',
|
||||||
'toBeResolvedTo',
|
'toBeResolvedTo',
|
||||||
'toBeRejectedWith',
|
'toBeRejectedWith',
|
||||||
'toBeRejectedWithError',
|
'toBeRejectedWithError',
|
||||||
'toBeRejectedWithMatching'
|
'toBeRejectedWithMatching'
|
||||||
],
|
];
|
||||||
matchers = {};
|
const matchers = {};
|
||||||
|
|
||||||
for (const name of availableMatchers) {
|
for (const name of availableMatchers) {
|
||||||
matchers[name] = jRequire[name](j$);
|
matchers[name] = jRequire[name](j$);
|
||||||
@@ -6863,11 +6865,11 @@ getJasmineRequireObj().toEqual = function(j$) {
|
|||||||
return {
|
return {
|
||||||
compare: function(actual, expected) {
|
compare: function(actual, expected) {
|
||||||
const result = {
|
const result = {
|
||||||
pass: false
|
pass: false
|
||||||
},
|
};
|
||||||
diffBuilder = new j$.private.DiffBuilder({
|
const diffBuilder = new j$.private.DiffBuilder({
|
||||||
prettyPrinter: matchersUtil.pp
|
prettyPrinter: matchersUtil.pp
|
||||||
});
|
});
|
||||||
|
|
||||||
result.pass = matchersUtil.equals(actual, expected, diffBuilder);
|
result.pass = matchersUtil.equals(actual, expected, diffBuilder);
|
||||||
|
|
||||||
@@ -7052,9 +7054,9 @@ getJasmineRequireObj().toHaveBeenCalledOnceWith = function(j$) {
|
|||||||
function toHaveBeenCalledOnceWith(matchersUtil) {
|
function toHaveBeenCalledOnceWith(matchersUtil) {
|
||||||
return {
|
return {
|
||||||
compare: function() {
|
compare: function() {
|
||||||
const args = Array.prototype.slice.call(arguments, 0),
|
const args = Array.prototype.slice.call(arguments, 0);
|
||||||
actual = args[0],
|
const actual = args[0];
|
||||||
expectedArgs = args.slice(1);
|
const expectedArgs = args.slice(1);
|
||||||
|
|
||||||
if (!j$.isSpy(actual)) {
|
if (!j$.isSpy(actual)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@@ -7171,8 +7173,8 @@ getJasmineRequireObj().toHaveBeenCalledTimes = function(j$) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const args = Array.prototype.slice.call(arguments, 0),
|
const args = Array.prototype.slice.call(arguments, 0);
|
||||||
result = { pass: false };
|
const result = { pass: false };
|
||||||
|
|
||||||
if (!j$.private.isNumber(expected)) {
|
if (!j$.private.isNumber(expected)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@@ -7241,10 +7243,10 @@ getJasmineRequireObj().toHaveBeenCalledWith = function(j$) {
|
|||||||
function toHaveBeenCalledWith(matchersUtil) {
|
function toHaveBeenCalledWith(matchersUtil) {
|
||||||
return {
|
return {
|
||||||
compare: function() {
|
compare: function() {
|
||||||
const args = Array.prototype.slice.call(arguments, 0),
|
const args = Array.prototype.slice.call(arguments, 0);
|
||||||
actual = args[0],
|
const actual = args[0];
|
||||||
expectedArgs = args.slice(1),
|
const expectedArgs = args.slice(1);
|
||||||
result = { pass: false };
|
const result = { pass: false };
|
||||||
|
|
||||||
if (!j$.isSpy(actual)) {
|
if (!j$.isSpy(actual)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@@ -10133,22 +10135,22 @@ getJasmineRequireObj().Spy = function(j$) {
|
|||||||
};
|
};
|
||||||
const { originalFn, customStrategies, defaultStrategyFn } = optionals || {};
|
const { originalFn, customStrategies, defaultStrategyFn } = optionals || {};
|
||||||
|
|
||||||
const numArgs = typeof originalFn === 'function' ? originalFn.length : 0,
|
const numArgs = typeof originalFn === 'function' ? originalFn.length : 0;
|
||||||
wrapper = makeFunc(numArgs, function(context, args, invokeNew) {
|
const wrapper = makeFunc(numArgs, function(context, args, invokeNew) {
|
||||||
return spy(context, args, invokeNew);
|
return spy(context, args, invokeNew);
|
||||||
}),
|
});
|
||||||
strategyDispatcher = new SpyStrategyDispatcher(
|
const strategyDispatcher = new SpyStrategyDispatcher(
|
||||||
{
|
{
|
||||||
name: name,
|
name: name,
|
||||||
fn: originalFn,
|
fn: originalFn,
|
||||||
getSpy: function() {
|
getSpy: function() {
|
||||||
return wrapper;
|
return wrapper;
|
||||||
},
|
|
||||||
customStrategies: customStrategies
|
|
||||||
},
|
},
|
||||||
matchersUtil
|
customStrategies: customStrategies
|
||||||
),
|
},
|
||||||
callTracker = new j$.private.CallTracker();
|
matchersUtil
|
||||||
|
);
|
||||||
|
const callTracker = new j$.private.CallTracker();
|
||||||
|
|
||||||
function makeFunc(length, fn) {
|
function makeFunc(length, fn) {
|
||||||
switch (length) {
|
switch (length) {
|
||||||
@@ -10595,10 +10597,10 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let pointer = obj,
|
let pointer = obj;
|
||||||
propsToSpyOn = [],
|
let propsToSpyOn = [];
|
||||||
properties,
|
let properties;
|
||||||
propertiesToSkip = [];
|
let propertiesToSkip = [];
|
||||||
|
|
||||||
while (
|
while (
|
||||||
pointer &&
|
pointer &&
|
||||||
@@ -11882,9 +11884,9 @@ getJasmineRequireObj().SuiteBuilder = function(j$) {
|
|||||||
|
|
||||||
function beforeAndAfterFns(targetSuite) {
|
function beforeAndAfterFns(targetSuite) {
|
||||||
return function() {
|
return function() {
|
||||||
let befores = [],
|
let befores = [];
|
||||||
afters = [],
|
let afters = [];
|
||||||
suite = targetSuite;
|
let suite = targetSuite;
|
||||||
|
|
||||||
while (suite) {
|
while (suite) {
|
||||||
befores = befores.concat(suite.beforeFns);
|
befores = befores.concat(suite.beforeFns);
|
||||||
@@ -12095,15 +12097,15 @@ getJasmineRequireObj().TreeProcessor = function(j$) {
|
|||||||
|
|
||||||
function segmentChildren(node, orderedChildren, stats, executableIndex) {
|
function segmentChildren(node, orderedChildren, stats, executableIndex) {
|
||||||
let currentSegment = {
|
let currentSegment = {
|
||||||
index: 0,
|
index: 0,
|
||||||
owner: node,
|
owner: node,
|
||||||
nodes: [],
|
nodes: [],
|
||||||
min: startingMin(executableIndex),
|
min: startingMin(executableIndex),
|
||||||
max: startingMax(executableIndex)
|
max: startingMax(executableIndex)
|
||||||
},
|
};
|
||||||
result = [currentSegment],
|
let result = [currentSegment];
|
||||||
lastMax = defaultMax,
|
let lastMax = defaultMax;
|
||||||
orderedChildSegments = orderChildSegments(orderedChildren, stats);
|
let orderedChildSegments = orderChildSegments(orderedChildren, stats);
|
||||||
|
|
||||||
function isSegmentBoundary(minIndex) {
|
function isSegmentBoundary(minIndex) {
|
||||||
return (
|
return (
|
||||||
@@ -12114,9 +12116,9 @@ getJasmineRequireObj().TreeProcessor = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < orderedChildSegments.length; i++) {
|
for (let i = 0; i < orderedChildSegments.length; i++) {
|
||||||
const childSegment = orderedChildSegments[i],
|
const childSegment = orderedChildSegments[i];
|
||||||
maxIndex = childSegment.max,
|
const maxIndex = childSegment.max;
|
||||||
minIndex = childSegment.min;
|
const minIndex = childSegment.min;
|
||||||
|
|
||||||
if (isSegmentBoundary(minIndex)) {
|
if (isSegmentBoundary(minIndex)) {
|
||||||
currentSegment = {
|
currentSegment = {
|
||||||
@@ -12139,12 +12141,12 @@ getJasmineRequireObj().TreeProcessor = function(j$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function orderChildSegments(children, stats) {
|
function orderChildSegments(children, stats) {
|
||||||
const specifiedOrder = [],
|
const specifiedOrder = [];
|
||||||
unspecifiedOrder = [];
|
const unspecifiedOrder = [];
|
||||||
|
|
||||||
for (let i = 0; i < children.length; i++) {
|
for (let i = 0; i < children.length; i++) {
|
||||||
const child = children[i],
|
const child = children[i];
|
||||||
segments = stats[child.id].segments;
|
const segments = stats[child.id].segments;
|
||||||
|
|
||||||
for (let j = 0; j < segments.length; j++) {
|
for (let j = 0; j < segments.length; j++) {
|
||||||
const seg = segments[j];
|
const seg = segments[j];
|
||||||
|
|||||||
Reference in New Issue
Block a user