Skip to content

Commit

Permalink
Add deep is available without using handler argument
Browse files Browse the repository at this point in the history
  • Loading branch information
FreePhoenix888 committed Nov 18, 2023
1 parent 58cde8c commit ea6d95d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/sync-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3049,4 +3049,20 @@ describe('sync handlers', () => {
type_id: customTypeLinkId
})
})
it('deep is available without using handler argument', async () => {
const customTypeLinkId = await deep.insert({
type_id: await deep.id("@deep-foundation/core", "Type")
}).then(result => result.data[0].id);
const handleInsertTypeLinkId = await deep.id('@deep-foundation/core', 'HandleInsert');
const supportsId = await deep.id("@deep-foundation/core", "plv8SupportsJs")
const handler = await insertHandler(handleInsertTypeLinkId, customTypeLinkId,
`() => {
if(deep) {
throw new Error("deep variable is available without using it from argument")
}
}`, undefined, supportsId);
await deep.insert({
type_id: customTypeLinkId
})
})
});

0 comments on commit ea6d95d

Please sign in to comment.