Buckets:
ktongue/docker_container / .cache /opencode /node_modules /fastify /test /diagnostics-channel /init.test.js
| const { test } = require('node:test') | |
| const proxyquire = require('proxyquire') | |
| test('diagnostics_channel when present and subscribers', t => { | |
| t.plan(3) | |
| let fastifyInHook | |
| const diagnostics = { | |
| channel (name) { | |
| t.assert.strictEqual(name, 'fastify.initialization') | |
| return { | |
| hasSubscribers: true, | |
| publish (event) { | |
| t.assert.ok(event.fastify) | |
| fastifyInHook = event.fastify | |
| } | |
| } | |
| }, | |
| '@noCallThru': true | |
| } | |
| const fastify = proxyquire('../../fastify', { | |
| 'node:diagnostics_channel': diagnostics | |
| })() | |
| t.assert.strictEqual(fastifyInHook, fastify) | |
| }) | |
| test('diagnostics_channel when present and no subscribers', t => { | |
| t.plan(1) | |
| const diagnostics = { | |
| channel (name) { | |
| t.assert.strictEqual(name, 'fastify.initialization') | |
| return { | |
| hasSubscribers: false, | |
| publish () { | |
| t.assert.fail('publish should not be called') | |
| } | |
| } | |
| }, | |
| '@noCallThru': true | |
| } | |
| proxyquire('../../fastify', { | |
| 'node:diagnostics_channel': diagnostics | |
| })() | |
| }) | |
Xet Storage Details
- Size:
- 1.1 kB
- Xet hash:
- 1810043b7e257300996137bce271bbebd8ca6838adb2478df19f5b6827448034
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.