Merge branch 'enelson/src-cleanup-2' of https://github.com/elliot-nelson/jasmine into elliot-nelson-enelson/src-cleanup-2
- Merges #1708 from @elliot-nelson
This commit is contained in:
@@ -137,7 +137,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
|||||||
console.error('Spec \'' + result.fullName + '\' has no expectations.');
|
console.error('Spec \'' + result.fullName + '\' has no expectations.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!symbols){
|
if (!symbols) {
|
||||||
symbols = find('.jasmine-symbol-summary');
|
symbols = find('.jasmine-symbol-summary');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
|
|||||||
'toMatch',
|
'toMatch',
|
||||||
'toThrow',
|
'toThrow',
|
||||||
'toThrowError',
|
'toThrowError',
|
||||||
'toThrowMatching',
|
'toThrowMatching'
|
||||||
],
|
],
|
||||||
matchers = {};
|
matchers = {};
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
|||||||
* @name jasmine.truthy
|
* @name jasmine.truthy
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
j$.truthy = function() {return new j$.Truthy();};
|
j$.truthy = function() { return new j$.Truthy(); };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
||||||
@@ -326,7 +326,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
|||||||
* @name jasmine.falsy
|
* @name jasmine.falsy
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
j$.falsy = function() {return new j$.Falsy();};
|
j$.falsy = function() { return new j$.Falsy(); };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
||||||
@@ -334,7 +334,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
|||||||
* @name jasmine.empty
|
* @name jasmine.empty
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
j$.empty = function() {return new j$.Empty();};
|
j$.empty = function() { return new j$.Empty(); };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
||||||
@@ -342,7 +342,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
|||||||
* @name jasmine.notEmpty
|
* @name jasmine.notEmpty
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
j$.notEmpty = function() {return new j$.NotEmpty();};
|
j$.notEmpty = function() { return new j$.NotEmpty(); };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
||||||
@@ -499,18 +499,6 @@ getJasmineRequireObj().util = function(j$) {
|
|||||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||||
};
|
};
|
||||||
|
|
||||||
function anyMatch(pattern, lines) {
|
|
||||||
var i;
|
|
||||||
|
|
||||||
for (i = 0; i < lines.length; i++) {
|
|
||||||
if (lines[i].match(pattern)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
util.errorWithStack = function errorWithStack () {
|
util.errorWithStack = function errorWithStack () {
|
||||||
// Don't throw and catch if we don't have to, because it makes it harder
|
// Don't throw and catch if we don't have to, because it makes it harder
|
||||||
// for users to debug their code with exception breakpoints.
|
// for users to debug their code with exception breakpoints.
|
||||||
@@ -537,8 +525,6 @@ getJasmineRequireObj().util = function(j$) {
|
|||||||
var result;
|
var result;
|
||||||
|
|
||||||
return function() {
|
return function() {
|
||||||
var trace;
|
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
result = callerFile();
|
result = callerFile();
|
||||||
}
|
}
|
||||||
@@ -592,7 +578,7 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
passedExpectations: [],
|
passedExpectations: [],
|
||||||
deprecationWarnings: [],
|
deprecationWarnings: [],
|
||||||
pendingReason: '',
|
pendingReason: '',
|
||||||
duration: null,
|
duration: null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1047,7 +1033,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
var defaultResourcesForRunnable = function(id, parentRunnableId) {
|
var defaultResourcesForRunnable = function(id, parentRunnableId) {
|
||||||
var resources = {spies: [], customEqualityTesters: [], customMatchers: {}, customSpyStrategies: {}};
|
var resources = {spies: [], customEqualityTesters: [], customMatchers: {}, customSpyStrategies: {}};
|
||||||
|
|
||||||
if(runnableResources[parentRunnableId]){
|
if(runnableResources[parentRunnableId]) {
|
||||||
resources.customEqualityTesters = j$.util.clone(runnableResources[parentRunnableId].customEqualityTesters);
|
resources.customEqualityTesters = j$.util.clone(runnableResources[parentRunnableId].customEqualityTesters);
|
||||||
resources.customMatchers = j$.util.clone(runnableResources[parentRunnableId].customMatchers);
|
resources.customMatchers = j$.util.clone(runnableResources[parentRunnableId].customMatchers);
|
||||||
}
|
}
|
||||||
@@ -1099,9 +1085,6 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
return buildExpectationResult(attrs);
|
return buildExpectationResult(attrs);
|
||||||
};
|
};
|
||||||
|
|
||||||
var maximumSpecCallbackDepth = 20;
|
|
||||||
var currentSpecCallbackDepth = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether Jasmine should throw an Error when an expectation fails.
|
* Sets whether Jasmine should throw an Error when an expectation fails.
|
||||||
* This causes a spec to only have one expectation failure.
|
* This causes a spec to only have one expectation failure.
|
||||||
@@ -1458,7 +1441,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.allowRespy = function(allow){
|
this.allowRespy = function(allow) {
|
||||||
spyRegistry.allowRespy(allow);
|
spyRegistry.allowRespy(allow);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1622,7 +1605,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
timeout: timeout || 0
|
timeout: timeout || 0
|
||||||
},
|
},
|
||||||
throwOnExpectationFailure: config.oneFailurePerSpec,
|
throwOnExpectationFailure: config.oneFailurePerSpec,
|
||||||
timer: new j$.Timer(),
|
timer: new j$.Timer()
|
||||||
});
|
});
|
||||||
return spec;
|
return spec;
|
||||||
|
|
||||||
@@ -1671,7 +1654,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
return spec;
|
return spec;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.fit = function(description, fn, timeout){
|
this.fit = function(description, fn, timeout) {
|
||||||
ensureIsNotNested('fit');
|
ensureIsNotNested('fit');
|
||||||
ensureIsFunctionOrAsync(fn, 'fit');
|
ensureIsFunctionOrAsync(fn, 'fit');
|
||||||
var spec = specFactory(description, fn, currentDeclarationSuite, timeout);
|
var spec = specFactory(description, fn, currentDeclarationSuite, timeout);
|
||||||
@@ -2247,7 +2230,7 @@ getJasmineRequireObj().CallTracker = function(j$) {
|
|||||||
*/
|
*/
|
||||||
this.allArgs = function() {
|
this.allArgs = function() {
|
||||||
var callArgs = [];
|
var callArgs = [];
|
||||||
for(var i = 0; i < calls.length; i++){
|
for(var i = 0; i < calls.length; i++) {
|
||||||
callArgs.push(calls[i].args);
|
callArgs.push(calls[i].args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3126,7 +3109,7 @@ getJasmineRequireObj().Expector = function(j$) {
|
|||||||
this.util = options.util || { buildFailureMessage: function() {} };
|
this.util = options.util || { buildFailureMessage: function() {} };
|
||||||
this.customEqualityTesters = options.customEqualityTesters || [];
|
this.customEqualityTesters = options.customEqualityTesters || [];
|
||||||
this.actual = options.actual;
|
this.actual = options.actual;
|
||||||
this.addExpectationResult = options.addExpectationResult || function(){};
|
this.addExpectationResult = options.addExpectationResult || function() {};
|
||||||
this.filters = new j$.ExpectationFilterChain();
|
this.filters = new j$.ExpectationFilterChain();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3780,7 +3763,6 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (i = 0; i < aLength || i < bLength; i++) {
|
for (i = 0; i < aLength || i < bLength; i++) {
|
||||||
var formatter = false;
|
|
||||||
diffBuilder.withPath(i, function() {
|
diffBuilder.withPath(i, function() {
|
||||||
if (i >= bLength) {
|
if (i >= bLength) {
|
||||||
diffBuilder.record(a[i], void 0, actualArrayIsLongerFormatter);
|
diffBuilder.record(a[i], void 0, actualArrayIsLongerFormatter);
|
||||||
@@ -3972,10 +3954,6 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|||||||
return extraKeys;
|
return extraKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
function has(obj, key) {
|
|
||||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
||||||
}
|
|
||||||
|
|
||||||
function isFunction(obj) {
|
function isFunction(obj) {
|
||||||
return typeof obj === 'function';
|
return typeof obj === 'function';
|
||||||
}
|
}
|
||||||
@@ -4142,7 +4120,7 @@ getJasmineRequireObj().toBe = function(j$) {
|
|||||||
return {
|
return {
|
||||||
compare: function(actual, expected) {
|
compare: function(actual, expected) {
|
||||||
var result = {
|
var result = {
|
||||||
pass: actual === expected,
|
pass: actual === expected
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof expected === 'object') {
|
if (typeof expected === 'object') {
|
||||||
@@ -4248,7 +4226,7 @@ getJasmineRequireObj().toBeFalsy = function() {
|
|||||||
return {
|
return {
|
||||||
compare: function(actual) {
|
compare: function(actual) {
|
||||||
return {
|
return {
|
||||||
pass: !!!actual
|
pass: !actual
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -4745,7 +4723,7 @@ getJasmineRequireObj().toHaveBeenCalledTimes = function(j$) {
|
|||||||
var args = Array.prototype.slice.call(arguments, 0),
|
var args = Array.prototype.slice.call(arguments, 0),
|
||||||
result = { pass: false };
|
result = { pass: false };
|
||||||
|
|
||||||
if (!j$.isNumber_(expected)){
|
if (!j$.isNumber_(expected)) {
|
||||||
throw new Error(getErrorMsg('The expected times failed is a required argument and must be a number.'));
|
throw new Error(getErrorMsg('The expected times failed is a required argument and must be a number.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5246,7 +5224,7 @@ getJasmineRequireObj().MockDate = function() {
|
|||||||
FakeDate.parse = GlobalDate.parse;
|
FakeDate.parse = GlobalDate.parse;
|
||||||
FakeDate.UTC = GlobalDate.UTC;
|
FakeDate.UTC = GlobalDate.UTC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return MockDate;
|
return MockDate;
|
||||||
};
|
};
|
||||||
@@ -5368,7 +5346,7 @@ getJasmineRequireObj().pp = function(j$) {
|
|||||||
}
|
}
|
||||||
this.format(array[i]);
|
this.format(array[i]);
|
||||||
}
|
}
|
||||||
if(array.length > length){
|
if(array.length > length) {
|
||||||
this.append(', ...');
|
this.append(', ...');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5408,7 +5386,7 @@ getJasmineRequireObj().pp = function(j$) {
|
|||||||
|
|
||||||
i++;
|
i++;
|
||||||
}, this );
|
}, this );
|
||||||
if (set.size > size){
|
if (set.size > size) {
|
||||||
this.append(', ...');
|
this.append(', ...');
|
||||||
}
|
}
|
||||||
this.append(' )');
|
this.append(' )');
|
||||||
@@ -5433,7 +5411,7 @@ getJasmineRequireObj().pp = function(j$) {
|
|||||||
|
|
||||||
i++;
|
i++;
|
||||||
}, this );
|
}, this );
|
||||||
if (map.size > size){
|
if (map.size > size) {
|
||||||
this.append(', ...');
|
this.append(', ...');
|
||||||
}
|
}
|
||||||
this.append(' )');
|
this.append(' )');
|
||||||
@@ -5613,7 +5591,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|||||||
this.queueableFns = queueableFns.concat(attrs.cleanupFns || []);
|
this.queueableFns = queueableFns.concat(attrs.cleanupFns || []);
|
||||||
this.firstCleanupIx = queueableFns.length;
|
this.firstCleanupIx = queueableFns.length;
|
||||||
this.onComplete = attrs.onComplete || emptyFn;
|
this.onComplete = attrs.onComplete || emptyFn;
|
||||||
this.clearStack = attrs.clearStack || function(fn) {fn();};
|
this.clearStack = attrs.clearStack || function(fn) { fn(); };
|
||||||
this.onException = attrs.onException || emptyFn;
|
this.onException = attrs.onException || emptyFn;
|
||||||
this.userContext = attrs.userContext || new j$.UserContext();
|
this.userContext = attrs.userContext || new j$.UserContext();
|
||||||
this.timeout = attrs.timeout || {setTimeout: setTimeout, clearTimeout: clearTimeout};
|
this.timeout = attrs.timeout || {setTimeout: setTimeout, clearTimeout: clearTimeout};
|
||||||
@@ -6890,7 +6868,7 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
fullName: this.getFullName(),
|
fullName: this.getFullName(),
|
||||||
failedExpectations: [],
|
failedExpectations: [],
|
||||||
deprecationWarnings: [],
|
deprecationWarnings: [],
|
||||||
duration: null,
|
duration: null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ getJasmineRequireObj().CallTracker = function(j$) {
|
|||||||
*/
|
*/
|
||||||
this.allArgs = function() {
|
this.allArgs = function() {
|
||||||
var callArgs = [];
|
var callArgs = [];
|
||||||
for(var i = 0; i < calls.length; i++){
|
for(var i = 0; i < calls.length; i++) {
|
||||||
callArgs.push(calls[i].args);
|
callArgs.push(calls[i].args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
var defaultResourcesForRunnable = function(id, parentRunnableId) {
|
var defaultResourcesForRunnable = function(id, parentRunnableId) {
|
||||||
var resources = {spies: [], customEqualityTesters: [], customMatchers: {}, customSpyStrategies: {}};
|
var resources = {spies: [], customEqualityTesters: [], customMatchers: {}, customSpyStrategies: {}};
|
||||||
|
|
||||||
if(runnableResources[parentRunnableId]){
|
if(runnableResources[parentRunnableId]) {
|
||||||
resources.customEqualityTesters = j$.util.clone(runnableResources[parentRunnableId].customEqualityTesters);
|
resources.customEqualityTesters = j$.util.clone(runnableResources[parentRunnableId].customEqualityTesters);
|
||||||
resources.customMatchers = j$.util.clone(runnableResources[parentRunnableId].customMatchers);
|
resources.customMatchers = j$.util.clone(runnableResources[parentRunnableId].customMatchers);
|
||||||
}
|
}
|
||||||
@@ -307,9 +307,6 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
return buildExpectationResult(attrs);
|
return buildExpectationResult(attrs);
|
||||||
};
|
};
|
||||||
|
|
||||||
var maximumSpecCallbackDepth = 20;
|
|
||||||
var currentSpecCallbackDepth = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether Jasmine should throw an Error when an expectation fails.
|
* Sets whether Jasmine should throw an Error when an expectation fails.
|
||||||
* This causes a spec to only have one expectation failure.
|
* This causes a spec to only have one expectation failure.
|
||||||
@@ -666,7 +663,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.allowRespy = function(allow){
|
this.allowRespy = function(allow) {
|
||||||
spyRegistry.allowRespy(allow);
|
spyRegistry.allowRespy(allow);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -830,7 +827,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
timeout: timeout || 0
|
timeout: timeout || 0
|
||||||
},
|
},
|
||||||
throwOnExpectationFailure: config.oneFailurePerSpec,
|
throwOnExpectationFailure: config.oneFailurePerSpec,
|
||||||
timer: new j$.Timer(),
|
timer: new j$.Timer()
|
||||||
});
|
});
|
||||||
return spec;
|
return spec;
|
||||||
|
|
||||||
@@ -879,7 +876,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
return spec;
|
return spec;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.fit = function(description, fn, timeout){
|
this.fit = function(description, fn, timeout) {
|
||||||
ensureIsNotNested('fit');
|
ensureIsNotNested('fit');
|
||||||
ensureIsFunctionOrAsync(fn, 'fit');
|
ensureIsFunctionOrAsync(fn, 'fit');
|
||||||
var spec = specFactory(description, fn, currentDeclarationSuite, timeout);
|
var spec = specFactory(description, fn, currentDeclarationSuite, timeout);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ getJasmineRequireObj().Expector = function(j$) {
|
|||||||
this.util = options.util || { buildFailureMessage: function() {} };
|
this.util = options.util || { buildFailureMessage: function() {} };
|
||||||
this.customEqualityTesters = options.customEqualityTesters || [];
|
this.customEqualityTesters = options.customEqualityTesters || [];
|
||||||
this.actual = options.actual;
|
this.actual = options.actual;
|
||||||
this.addExpectationResult = options.addExpectationResult || function(){};
|
this.addExpectationResult = options.addExpectationResult || function() {};
|
||||||
this.filters = new j$.ExpectationFilterChain();
|
this.filters = new j$.ExpectationFilterChain();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ getJasmineRequireObj().MockDate = function() {
|
|||||||
FakeDate.parse = GlobalDate.parse;
|
FakeDate.parse = GlobalDate.parse;
|
||||||
FakeDate.UTC = GlobalDate.UTC;
|
FakeDate.UTC = GlobalDate.UTC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return MockDate;
|
return MockDate;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ getJasmineRequireObj().pp = function(j$) {
|
|||||||
}
|
}
|
||||||
this.format(array[i]);
|
this.format(array[i]);
|
||||||
}
|
}
|
||||||
if(array.length > length){
|
if(array.length > length) {
|
||||||
this.append(', ...');
|
this.append(', ...');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ getJasmineRequireObj().pp = function(j$) {
|
|||||||
|
|
||||||
i++;
|
i++;
|
||||||
}, this );
|
}, this );
|
||||||
if (set.size > size){
|
if (set.size > size) {
|
||||||
this.append(', ...');
|
this.append(', ...');
|
||||||
}
|
}
|
||||||
this.append(' )');
|
this.append(' )');
|
||||||
@@ -180,7 +180,7 @@ getJasmineRequireObj().pp = function(j$) {
|
|||||||
|
|
||||||
i++;
|
i++;
|
||||||
}, this );
|
}, this );
|
||||||
if (map.size > size){
|
if (map.size > size) {
|
||||||
this.append(', ...');
|
this.append(', ...');
|
||||||
}
|
}
|
||||||
this.append(' )');
|
this.append(' )');
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|||||||
this.queueableFns = queueableFns.concat(attrs.cleanupFns || []);
|
this.queueableFns = queueableFns.concat(attrs.cleanupFns || []);
|
||||||
this.firstCleanupIx = queueableFns.length;
|
this.firstCleanupIx = queueableFns.length;
|
||||||
this.onComplete = attrs.onComplete || emptyFn;
|
this.onComplete = attrs.onComplete || emptyFn;
|
||||||
this.clearStack = attrs.clearStack || function(fn) {fn();};
|
this.clearStack = attrs.clearStack || function(fn) { fn(); };
|
||||||
this.onException = attrs.onException || emptyFn;
|
this.onException = attrs.onException || emptyFn;
|
||||||
this.userContext = attrs.userContext || new j$.UserContext();
|
this.userContext = attrs.userContext || new j$.UserContext();
|
||||||
this.timeout = attrs.timeout || {setTimeout: setTimeout, clearTimeout: clearTimeout};
|
this.timeout = attrs.timeout || {setTimeout: setTimeout, clearTimeout: clearTimeout};
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
passedExpectations: [],
|
passedExpectations: [],
|
||||||
deprecationWarnings: [],
|
deprecationWarnings: [],
|
||||||
pendingReason: '',
|
pendingReason: '',
|
||||||
duration: null,
|
duration: null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
fullName: this.getFullName(),
|
fullName: this.getFullName(),
|
||||||
failedExpectations: [],
|
failedExpectations: [],
|
||||||
deprecationWarnings: [],
|
deprecationWarnings: [],
|
||||||
duration: null,
|
duration: null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
|||||||
* @name jasmine.truthy
|
* @name jasmine.truthy
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
j$.truthy = function() {return new j$.Truthy();};
|
j$.truthy = function() { return new j$.Truthy(); };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
||||||
@@ -179,7 +179,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
|||||||
* @name jasmine.falsy
|
* @name jasmine.falsy
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
j$.falsy = function() {return new j$.Falsy();};
|
j$.falsy = function() { return new j$.Falsy(); };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
||||||
@@ -187,7 +187,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
|||||||
* @name jasmine.empty
|
* @name jasmine.empty
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
j$.empty = function() {return new j$.Empty();};
|
j$.empty = function() { return new j$.Empty(); };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
||||||
@@ -195,7 +195,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
|||||||
* @name jasmine.notEmpty
|
* @name jasmine.notEmpty
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
j$.notEmpty = function() {return new j$.NotEmpty();};
|
j$.notEmpty = function() { return new j$.NotEmpty(); };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
|
||||||
|
|||||||
@@ -225,7 +225,6 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (i = 0; i < aLength || i < bLength; i++) {
|
for (i = 0; i < aLength || i < bLength; i++) {
|
||||||
var formatter = false;
|
|
||||||
diffBuilder.withPath(i, function() {
|
diffBuilder.withPath(i, function() {
|
||||||
if (i >= bLength) {
|
if (i >= bLength) {
|
||||||
diffBuilder.record(a[i], void 0, actualArrayIsLongerFormatter);
|
diffBuilder.record(a[i], void 0, actualArrayIsLongerFormatter);
|
||||||
@@ -417,10 +416,6 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|||||||
return extraKeys;
|
return extraKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
function has(obj, key) {
|
|
||||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
||||||
}
|
|
||||||
|
|
||||||
function isFunction(obj) {
|
function isFunction(obj) {
|
||||||
return typeof obj === 'function';
|
return typeof obj === 'function';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
|
|||||||
'toMatch',
|
'toMatch',
|
||||||
'toThrow',
|
'toThrow',
|
||||||
'toThrowError',
|
'toThrowError',
|
||||||
'toThrowMatching',
|
'toThrowMatching'
|
||||||
],
|
],
|
||||||
matchers = {};
|
matchers = {};
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ getJasmineRequireObj().toBe = function(j$) {
|
|||||||
return {
|
return {
|
||||||
compare: function(actual, expected) {
|
compare: function(actual, expected) {
|
||||||
var result = {
|
var result = {
|
||||||
pass: actual === expected,
|
pass: actual === expected
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof expected === 'object') {
|
if (typeof expected === 'object') {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ getJasmineRequireObj().toBeFalsy = function() {
|
|||||||
return {
|
return {
|
||||||
compare: function(actual) {
|
compare: function(actual) {
|
||||||
return {
|
return {
|
||||||
pass: !!!actual
|
pass: !actual
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ getJasmineRequireObj().toHaveBeenCalledTimes = function(j$) {
|
|||||||
var args = Array.prototype.slice.call(arguments, 0),
|
var args = Array.prototype.slice.call(arguments, 0),
|
||||||
result = { pass: false };
|
result = { pass: false };
|
||||||
|
|
||||||
if (!j$.isNumber_(expected)){
|
if (!j$.isNumber_(expected)) {
|
||||||
throw new Error(getErrorMsg('The expected times failed is a required argument and must be a number.'));
|
throw new Error(getErrorMsg('The expected times failed is a required argument and must be a number.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,18 +100,6 @@ getJasmineRequireObj().util = function(j$) {
|
|||||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||||
};
|
};
|
||||||
|
|
||||||
function anyMatch(pattern, lines) {
|
|
||||||
var i;
|
|
||||||
|
|
||||||
for (i = 0; i < lines.length; i++) {
|
|
||||||
if (lines[i].match(pattern)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
util.errorWithStack = function errorWithStack () {
|
util.errorWithStack = function errorWithStack () {
|
||||||
// Don't throw and catch if we don't have to, because it makes it harder
|
// Don't throw and catch if we don't have to, because it makes it harder
|
||||||
// for users to debug their code with exception breakpoints.
|
// for users to debug their code with exception breakpoints.
|
||||||
@@ -138,8 +126,6 @@ getJasmineRequireObj().util = function(j$) {
|
|||||||
var result;
|
var result;
|
||||||
|
|
||||||
return function() {
|
return function() {
|
||||||
var trace;
|
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
result = callerFile();
|
result = callerFile();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
|||||||
console.error('Spec \'' + result.fullName + '\' has no expectations.');
|
console.error('Spec \'' + result.fullName + '\' has no expectations.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!symbols){
|
if (!symbols) {
|
||||||
symbols = find('.jasmine-symbol-summary');
|
symbols = find('.jasmine-symbol-summary');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user