biome-ignore-all lint/correctness/noUnusedVariables: test
()
| 1 | // Test callable function API |
| 2 | /** biome-ignore-all lint/correctness/noUnusedVariables: test */ |
| 3 | function testCallableAPI() { |
| 4 | // ✅ Should work - correct callable syntax |
| 5 | window.op('track', 'button_clicked', { location: 'header' }); |
| 6 | window.op('identify', { profileId: 'user123', email: 'test@example.com' }); |
| 7 | window.op('init', { clientId: 'test-client-id' }); |
| 8 | window.op('screenView', '/page', { title: 'Test Page' }); |
| 9 | window.op('setGlobalProperties', { version: '1.0.0' }); |
| 10 | |
| 11 | // ❌ Should error - wrong method name |
| 12 | // @ts-expect-error - 'invalidMethod' is not a valid method |
| 13 | window.op('invalidMethod', 'test'); |
| 14 | |
| 15 | // ❌ Should error - wrong arguments for track |
| 16 | // @ts-expect-error - track expects (name: string, properties?: TrackProperties) |
| 17 | window.op('track', 123); |
| 18 | } |
| 19 | |
| 20 | // Test direct method API |
| 21 | function testDirectMethodAPI() { |
nothing calls this directly
no outgoing calls
no test coverage detected