Comparing version 5.3.0 to 5.3.1
@@ -151,3 +151,3 @@ const ConsoleSpecFilter = require("./filters/console_spec_filter"); | ||
reporter[eventName] = function (payload) { | ||
sendIfConnected(clusterWorker, { | ||
const msg = { | ||
type: 'reporterEvent', | ||
@@ -161,3 +161,14 @@ eventName, | ||
} | ||
}); | ||
}; | ||
try { | ||
sendIfConnected(clusterWorker, msg); | ||
} catch (e) { | ||
if (e instanceof TypeError) { | ||
msg.payload = fixNonSerializableReporterEvent(payload); | ||
sendIfConnected(clusterWorker, msg); | ||
} else { | ||
throw e; | ||
} | ||
} | ||
}; | ||
@@ -186,3 +197,27 @@ } | ||
function fixNonSerializableReporterEvent(payload) { | ||
payload = {...payload}; | ||
for (const ak of ['passedExpectations', 'failedExpectations']) { | ||
if (payload[ak]) { | ||
payload[ak] = payload[ak].map(function(expectation) { | ||
expectation = {...expectation}; | ||
for (const vk of ['expected', 'actual']) { | ||
try { | ||
JSON.stringify(expectation[vk]); | ||
} catch (ex) { | ||
expectation[vk] = '<not serializable>'; | ||
} | ||
} | ||
return expectation; | ||
}); | ||
} | ||
} | ||
return payload; | ||
} | ||
module.exports = ParallelWorker; |
@@ -13,3 +13,3 @@ { | ||
"license": "MIT", | ||
"version": "5.3.0", | ||
"version": "5.3.1", | ||
"repository": { | ||
@@ -16,0 +16,0 @@ "type": "git", |
@@ -54,11 +54,7 @@ # The Jasmine Package | ||
Documentation: [jasmine.github.io](https://jasmine.github.io) | ||
Documentation: [jasmine.github.io](https://jasmine.github.io)<br> | ||
Please file issues here at GitHub. | ||
Copyright (c) 2014-2019 Pivotal Labs | ||
Copyright (c) 2014-2023 The Jasmine developers | ||
Copyright (c) 2014-2019 Pivotal Labs<br> | ||
Copyright (c) 2014-2024 The Jasmine developers<br> | ||
This software is licensed under the MIT License. | ||
## License | ||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine-npm.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine-npm?ref=badge_large) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79544
2235
60