From fb6137591f920fde98c74dd2fe582a92b2bc8551 Mon Sep 17 00:00:00 2001 From: Michael Belousov Date: Mon, 22 Jan 2024 12:56:19 -0500 Subject: [PATCH] cherrypick better prop changes allowed --- .../src/test/IModelTransformerUtils.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/transformer/src/test/IModelTransformerUtils.ts b/packages/transformer/src/test/IModelTransformerUtils.ts index 441394bd..988a23a9 100644 --- a/packages/transformer/src/test/IModelTransformerUtils.ts +++ b/packages/transformer/src/test/IModelTransformerUtils.ts @@ -301,11 +301,16 @@ export async function assertIdentityTransformation( mappedRelationTargetInTargetId ); } else if (!propChangesAllowed) { - // kept for conditional breakpoints - const _propEq = TestUtils.advancedDeepEqual(targetElem.asAny[propName], sourceElem.asAny[propName]); - expect(targetElem.asAny[propName]).to.deep.advancedEqual( - sourceElem.asAny[propName] - ); + try { + expect( + (targetElem as any)[propName], + `${targetElem.id}[${propName}] didn't match ${sourceElem.id}[${propName}]` + ).to.deep.advancedEqual((sourceElem as any)[propName]); + } catch (err) { + // for debugging broken tests + debugger; // eslint-disable-line no-debugger + throw err; + } } } const quickClone = (obj: any) => JSON.parse(JSON.stringify(obj));