@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2008-2014 Pivotal Labs
|
||||
Copyright (c) 2008-2015 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2008-2014 Pivotal Labs
|
||||
Copyright (c) 2008-2015 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2008-2014 Pivotal Labs
|
||||
Copyright (c) 2008-2015 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2008-2014 Pivotal Labs
|
||||
Copyright (c) 2008-2015 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
@@ -853,7 +853,8 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
passed: false,
|
||||
expected: '',
|
||||
actual: '',
|
||||
message: message
|
||||
message: message,
|
||||
error: error && error.message ? error : null
|
||||
});
|
||||
};
|
||||
}
|
||||
@@ -2419,7 +2420,7 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
||||
return result;
|
||||
|
||||
function has(obj, key) {
|
||||
return obj.hasOwnProperty(key);
|
||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
||||
|
||||
function isFunction(obj) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2008-2014 Pivotal Labs
|
||||
Copyright (c) 2008-2015 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@@ -143,7 +143,8 @@ describe("Env integration", function() {
|
||||
|
||||
it('explicitly fails a spec', function(done) {
|
||||
var env = new j$.Env(),
|
||||
specDone = jasmine.createSpy('specDone');
|
||||
specDone = jasmine.createSpy('specDone'),
|
||||
errorObj = new Error('error message');
|
||||
|
||||
env.addReporter({
|
||||
specDone: specDone,
|
||||
@@ -161,9 +162,15 @@ describe("Env integration", function() {
|
||||
})]
|
||||
}));
|
||||
expect(specDone).toHaveBeenCalledWith(jasmine.objectContaining({
|
||||
description: 'has a message from an Error',
|
||||
description: 'has a message and stack trace from an Error',
|
||||
failedExpectations: [jasmine.objectContaining({
|
||||
message: 'Failed: error message'
|
||||
message: 'Failed: error message',
|
||||
stack: {
|
||||
asymmetricMatch: function(other) {
|
||||
var firstLine = other.split('\n')[1];
|
||||
return firstLine.indexOf('EnvSpec') >= 0;
|
||||
}
|
||||
}
|
||||
})]
|
||||
}));
|
||||
done();
|
||||
@@ -179,8 +186,8 @@ describe("Env integration", function() {
|
||||
env.fail('messy message');
|
||||
});
|
||||
|
||||
env.it('has a message from an Error', function() {
|
||||
env.fail(new Error('error message'));
|
||||
env.it('has a message and stack trace from an Error', function() {
|
||||
env.fail(errorObj);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -445,7 +445,8 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
passed: false,
|
||||
expected: '',
|
||||
actual: '',
|
||||
message: message
|
||||
message: message,
|
||||
error: error && error.message ? error : null
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user