diff --git a/tests/unit/nodes/array.spec.ts b/tests/unit/nodes/array.spec.ts index 4a855be..695eeac 100644 --- a/tests/unit/nodes/array.spec.ts +++ b/tests/unit/nodes/array.spec.ts @@ -440,7 +440,8 @@ test.group('Array node', () => { ` isArrayMember: true,`, '});', `ensureExists(root_item_item);`, - `if (ensureIsObject(root_item_item)) {`, + `const root_item_item_is_object = ensureIsObject(root_item_item);`, + `if (root_item_item_is_object) {`, `const root_item_item_out = {};`, `root_item_out[root_item_i] = root_item_item_out;`, `const contacts_3 = defineValue(root_item_item.value['contacts'], {`, @@ -588,7 +589,8 @@ test.group('Array node', () => { ` isArrayMember: true,`, '});', `ensureExists(root_item_item);`, - `if (ensureIsObject(root_item_item)) {`, + `const root_item_item_is_object = ensureIsObject(root_item_item);`, + `if (root_item_item_is_object) {`, `const root_item_item_out = {};`, `root_item_out[root_item_i] = root_item_item_out;`, `const primaryContacts_3 = defineValue(root_item_item.value['primary.contacts'], {`, diff --git a/tests/unit/scripts/object/guard.spec.ts b/tests/unit/scripts/object/guard.spec.ts index 9d4519d..1454fcc 100644 --- a/tests/unit/scripts/object/guard.spec.ts +++ b/tests/unit/scripts/object/guard.spec.ts @@ -18,11 +18,7 @@ test.group('Scripts | define object guard', () => { guardedCodeSnippet: 'console.log(profile)', }) - assert.doesNotThrows(() => validateCode(jsOutput)) - assert.assertFormatted(jsOutput, [ - `if (ensureIsObject(profile)) {`, - `console.log(profile)`, - `}`, - ]) + assert.doesNotThrow(() => validateCode(jsOutput)) + assert.assertFormatted(jsOutput, [`if (profile_is_object) {`, `console.log(profile)`, `}`]) }) })