Include symbol properties in matcher diffs

* #1966
This commit is contained in:
Steve Gravrock
2022-05-07 13:26:15 -07:00
parent 9d80377fe3
commit 468e9577cd
7 changed files with 81 additions and 36 deletions

View File

@@ -24,8 +24,8 @@ getJasmineRequireObj().ObjectPath = function(j$) {
};
function formatPropertyAccess(prop) {
if (typeof prop === 'number') {
return '[' + prop + ']';
if (typeof prop === 'number' || typeof prop === 'symbol') {
return '[' + prop.toString() + ']';
}
if (isValidIdentifier(prop)) {

View File

@@ -610,11 +610,13 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
);
}
function formatKeyValuePairs(pp, obj) {
var formatted = '';
for (var key in obj) {
formatted += '\n ' + key + ': ' + pp(obj[key]);
function formatKeyValuePairs(pp, keyValuePairs) {
let formatted = '';
for (const [key, value] of keyValuePairs) {
formatted += '\n ' + key.toString() + ': ' + pp(value);
}
return formatted;
}