Skip to content

Commit

Permalink
test: fix breaking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Nov 30, 2024
1 parent 1257d44 commit 9b15168
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 4 additions & 2 deletions tests/unit/nodes/array.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'], {`,
Expand Down Expand Up @@ -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'], {`,
Expand Down
8 changes: 2 additions & 6 deletions tests/unit/scripts/object/guard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)`, `}`])
})
})

0 comments on commit 9b15168

Please sign in to comment.