diff --git a/lib/console/console.js b/lib/console/console.js index a65876e9..e1548066 100644 --- a/lib/console/console.js +++ b/lib/console/console.js @@ -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 diff --git a/lib/jasmine-core/boot.js b/lib/jasmine-core/boot.js index 8da6900b..338b59ce 100644 --- a/lib/jasmine-core/boot.js +++ b/lib/jasmine-core/boot.js @@ -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 diff --git a/lib/jasmine-core/jasmine-html.js b/lib/jasmine-core/jasmine-html.js index 6f6c4cce..04562808 100644 --- a/lib/jasmine-core/jasmine-html.js +++ b/lib/jasmine-core/jasmine-html.js @@ -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 diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 23201931..56fe8fc9 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -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) { diff --git a/lib/jasmine-core/node_boot.js b/lib/jasmine-core/node_boot.js index fb4faa08..a0fc4a25 100644 --- a/lib/jasmine-core/node_boot.js +++ b/lib/jasmine-core/node_boot.js @@ -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 diff --git a/spec/core/integration/EnvSpec.js b/spec/core/integration/EnvSpec.js index ea643178..4f60a4ff 100644 --- a/spec/core/integration/EnvSpec.js +++ b/spec/core/integration/EnvSpec.js @@ -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); }); }); diff --git a/src/core/Env.js b/src/core/Env.js index 18dce14a..44f94c8b 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -445,7 +445,8 @@ getJasmineRequireObj().Env = function(j$) { passed: false, expected: '', actual: '', - message: message + message: message, + error: error && error.message ? error : null }); }; }