File
Blob: src/workerd/api/tests/tail-worker-test-invalid.js
| 1 | // Copyright (c) 2017-2023 Cloudflare, Inc. |
| 2 | // Licensed under the Apache 2.0 license found in the LICENSE file or at: |
| 3 | // https://opensource.org/licenses/Apache-2.0 |
| 4 | |
| 5 | export default { |
| 6 | // https://developers.cloudflare.com/workers/observability/logs/tail-workers/ |
| 7 | tailStream(event, env, ctx) { |
| 8 | // Return an invalid handler |
| 9 | return 42; |
| 10 | }, |
| 11 | }; |
| 12 | |
| 13 | export const test = { |
| 14 | async test() { |
| 15 | await scheduler.wait(50); |
| 16 | // Tests for a bug where we tried to report an outcome event to a stream after setting up the |
| 17 | // stream handler with the onset event failed – with an invalid tail handler, we should not be |
| 18 | // failing the entire test but only return an error for the affected worker. |
| 19 | }, |
| 20 | }; |