* Build a single-module worker script: the compiled ConsoleLogger source * (self-contained, no imports) plus a fetch handler that exercises it.
()
| 36 | * (self-contained, no imports) plus a fetch handler that exercises it. |
| 37 | */ |
| 38 | async function buildWorkerScript(): Promise<string> { |
| 39 | const loggerSource = await readFile(LOGGER_DIST, 'utf8') |
| 40 | return `${loggerSource} |
| 41 | export default { |
| 42 | fetch() { |
| 43 | const logger = new ConsoleLogger() |
| 44 | logger.debug('E2E-DEBUG-HEADLINE', { |
| 45 | payload: { nested: { deeper: { deepest: { marker: 'E2E-META-DEPTH-5' } } } }, |
| 46 | }) |
| 47 | logger.error('E2E-ERROR-HEADLINE', { cause: new Error('E2E-UPSTREAM-401') }) |
| 48 | const circular = { name: 'E2E-CIRCULAR' } |
| 49 | circular.self = circular |
| 50 | logger.warn('E2E-WARN-HEADLINE', circular) |
| 51 | return new Response('ok') |
| 52 | }, |
| 53 | } |
| 54 | ` |
| 55 | } |
| 56 | |
| 57 | test.describe('ConsoleLogger on real workerd', () => { |
| 58 | test('meta payloads reach the log stream at full depth', async () => { |
no outgoing calls
no test coverage detected