@@ -10,5 +10,38 @@ interface TestHybridObject {
10
10
createNewHybridObject : ( ) => TestHybridObject
11
11
}
12
12
13
- const hybridObject = FilamentProxy . createTestObject ( ) as TestHybridObject
14
- console . log ( hybridObject . int )
13
+ export function testHybridObject ( ) {
14
+ console . log ( '------ BEGIN HybridObject tests...' )
15
+ // 1. Creation
16
+ console . log ( 'Creating HybridObject...' )
17
+ const hybridObject = FilamentProxy . createTestObject ( ) as TestHybridObject
18
+ console . log ( 'Created HybridObject!' )
19
+
20
+ // 2. Logging the entire thing as JSON
21
+ console . log ( hybridObject )
22
+
23
+ // 3. Int Getter & Setter
24
+ console . log ( `Int: ${ hybridObject . int } ` )
25
+ hybridObject . int = 6723
26
+ console . log ( `New Int: ${ hybridObject . int } ` )
27
+
28
+ // 4. String Getter & Setter
29
+ console . log ( `String: ${ hybridObject . string } ` )
30
+ hybridObject . string = 'new string value!'
31
+ console . log ( `New String: ${ hybridObject . string } ` )
32
+
33
+ // 5. Testing multiple arguments and maps
34
+ const result = hybridObject . multipleArguments ( 5 , true , 'hahah!' )
35
+ console . log ( `multipleArguments() -> ${ JSON . stringify ( result ) } ` )
36
+
37
+ // 6. Testing callbacks
38
+ hybridObject . sayHelloCallback ( ( ) => 'hello from JS!' )
39
+ const getter = hybridObject . getIntGetter ( )
40
+ console . log ( `Int getter: ${ getter ( ) } ` )
41
+
42
+ // 7. Create a new one
43
+ const newObject = hybridObject . createNewHybridObject ( )
44
+ console . log ( `Created new hybrid object!` , newObject )
45
+
46
+ console . log ( '------ END HybridObject tests!' )
47
+ }
0 commit comments