Merge branch 'onerror' of https://github.com/johnjbarton/jasmine into johnjbarton-onerror
- Merges #1644 from @jognjbarton
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2008-2018 Pivotal Labs
|
Copyright (c) 2008-2019 Pivotal Labs
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2008-2018 Pivotal Labs
|
Copyright (c) 2008-2019 Pivotal Labs
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2008-2018 Pivotal Labs
|
Copyright (c) 2008-2019 Pivotal Labs
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
@@ -877,11 +877,12 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
|
|
||||||
if (!options.suppressLoadErrors) {
|
if (!options.suppressLoadErrors) {
|
||||||
installGlobalErrors();
|
installGlobalErrors();
|
||||||
globalErrors.pushListener(function(message, filename, lineno) {
|
globalErrors.pushListener(function(message, filename, lineno, colNo, err) {
|
||||||
topSuite.result.failedExpectations.push({
|
topSuite.result.failedExpectations.push({
|
||||||
passed: false,
|
passed: false,
|
||||||
globalErrorType: 'load',
|
globalErrorType: 'load',
|
||||||
message: message,
|
message: message,
|
||||||
|
stack: err && err.stack,
|
||||||
filename: filename,
|
filename: filename,
|
||||||
lineno: lineno
|
lineno: lineno
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2008-2018 Pivotal Labs
|
Copyright (c) 2008-2019 Pivotal Labs
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -2046,6 +2046,7 @@ describe("Env integration", function() {
|
|||||||
passed: false,
|
passed: false,
|
||||||
globalErrorType: 'load',
|
globalErrorType: 'load',
|
||||||
message: 'Uncaught SyntaxError: Unexpected end of input',
|
message: 'Uncaught SyntaxError: Unexpected end of input',
|
||||||
|
stack: 'a stack',
|
||||||
filename: 'borkenSpec.js',
|
filename: 'borkenSpec.js',
|
||||||
lineno: 42
|
lineno: 42
|
||||||
},
|
},
|
||||||
@@ -2053,6 +2054,7 @@ describe("Env integration", function() {
|
|||||||
passed: false,
|
passed: false,
|
||||||
globalErrorType: 'load',
|
globalErrorType: 'load',
|
||||||
message: 'Uncaught Error: ENOCHEESE',
|
message: 'Uncaught Error: ENOCHEESE',
|
||||||
|
stack: undefined,
|
||||||
filename: undefined,
|
filename: undefined,
|
||||||
lineno: undefined
|
lineno: undefined
|
||||||
}
|
}
|
||||||
@@ -2062,7 +2064,7 @@ describe("Env integration", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
env.addReporter(reporter);
|
env.addReporter(reporter);
|
||||||
global.onerror('Uncaught SyntaxError: Unexpected end of input', 'borkenSpec.js', 42);
|
global.onerror('Uncaught SyntaxError: Unexpected end of input', 'borkenSpec.js', 42, undefined, {stack: 'a stack'});
|
||||||
global.onerror('Uncaught Error: ENOCHEESE');
|
global.onerror('Uncaught Error: ENOCHEESE');
|
||||||
|
|
||||||
env.execute();
|
env.execute();
|
||||||
|
|||||||
+2
-1
@@ -100,11 +100,12 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
|
|
||||||
if (!options.suppressLoadErrors) {
|
if (!options.suppressLoadErrors) {
|
||||||
installGlobalErrors();
|
installGlobalErrors();
|
||||||
globalErrors.pushListener(function(message, filename, lineno) {
|
globalErrors.pushListener(function(message, filename, lineno, colNo, err) {
|
||||||
topSuite.result.failedExpectations.push({
|
topSuite.result.failedExpectations.push({
|
||||||
passed: false,
|
passed: false,
|
||||||
globalErrorType: 'load',
|
globalErrorType: 'load',
|
||||||
message: message,
|
message: message,
|
||||||
|
stack: err && err.stack,
|
||||||
filename: filename,
|
filename: filename,
|
||||||
lineno: lineno
|
lineno: lineno
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user