Home / File/ head.test.js — fastify Source File

head.test.js — fastify Source File

Architecture documentation for head.test.js, a javascript file in the fastify codebase.

Entity Profile

Source Code

'use strict'

const { test } = require('node:test')
const fastify = require('../../fastify')()

const schema = {
  schema: {
    response: {
      '2xx': {
        type: 'null'
      }
    }
  }
}

const querySchema = {
  schema: {
    querystring: {
      type: 'object',
      properties: {
        hello: {
          type: 'integer'
        }
      }
    }
  }
}

const paramsSchema = {
  schema: {
    params: {
      type: 'object',
      properties: {
        foo: {
          type: 'string'
        },
        test: {
          type: 'integer'
        }
      }
    }
  }
}

test('shorthand - head', t => {
  t.plan(1)
  try {
    fastify.head('/', schema, function (req, reply) {
      reply.code(200).send(null)
    })
    t.assert.ok(true)
  } catch (e) {
    t.assert.fail()
  }
})

test('shorthand - custom head', t => {
  t.plan(1)
  try {
    fastify.head('/proxy/*', function (req, reply) {
// ... (204 more lines)

Frequently Asked Questions

What does head.test.js do?
head.test.js is a source file in the fastify codebase, written in javascript.
Where is head.test.js in the architecture?
head.test.js is located at test/http-methods/head.test.js (directory: test/http-methods).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free