diff --git a/example/Tests/worklet-tests.ts b/example/Tests/worklet-tests.ts index 92c910a..db76868 100644 --- a/example/Tests/worklet-tests.ts +++ b/example/Tests/worklet-tests.ts @@ -197,6 +197,41 @@ export const worklet_tests = { }); return ExpectValue(result, 42); }, + check_jsi_object_is_spreadable_after_worklet: async () => { + const func = () => { + "worklet"; + return { a: 100 }; + }; + const result = Worklets.defaultContext.runAsync(func); + const spreadObject = { ...result }; + return ExpectValue(spreadObject, { a: 100 }); + }, + check_jsi_object_is_assignable_after_worklet: async () => { + const func = () => { + "worklet"; + return { a: 100 }; + }; + const result = Worklets.defaultContext.runAsync(func); + const assignedObject = Object.assign({}, result); + return ExpectValue(assignedObject, { a: 100 }); + }, + check_jsi_object_is_spreadable_inside_worklet: async () => { + const func = () => { + "worklet"; + const testObject = { a: 100, b: "200" }; + return { ...testObject }; + }; + const result = Worklets.defaultContext.runAsync(func); + return ExpectValue(result, { a: 100, b: "200" }); + }, + check_jsi_object_is_returned_from_worklet: async () => { + const func = () => { + "worklet"; + return { a: 100, b: "200" }; + }; + const result = Worklets.defaultContext.runAsync(func); + return ExpectValue(result, { a: 100, b: "200" }); + }, check_worklet_checker_works: () => { const func = () => { "worklet";