Buckets:
| const { test } = require('node:test') | |
| const Fastify = require('..') | |
| const { | |
| FST_ERR_DEC_ALREADY_PRESENT | |
| } = require('../lib/errors') | |
| test('Should be able to override the default use API', t => { | |
| t.plan(1) | |
| const fastify = Fastify() | |
| fastify.decorate('use', () => true) | |
| t.assert.strictEqual(fastify.use(), true) | |
| }) | |
| test('Cannot decorate use twice', t => { | |
| t.plan(1) | |
| const fastify = Fastify() | |
| fastify.decorate('use', () => true) | |
| try { | |
| fastify.decorate('use', () => true) | |
| } catch (err) { | |
| t.assert.ok(err instanceof FST_ERR_DEC_ALREADY_PRESENT) | |
| } | |
| }) | |
| test('Encapsulation works', t => { | |
| const fastify = Fastify() | |
| fastify.register((instance, opts, done) => { | |
| instance.decorate('use', () => true) | |
| t.assert.strictEqual(instance.use(), true) | |
| done() | |
| }) | |
| fastify.ready() | |
| }) | |
Xet Storage Details
- Size:
- 828 Bytes
- Xet hash:
- ce4238ed508f3f8356d68099d479004198064eebd32b1209be7df57c2ab9a5f5
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.