Socket
Book a DemoInstallSign in
Socket

@useoptic/fastify-capture

Package Overview
Dependencies
Maintainers
0
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@useoptic/fastify-capture

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
0
Created
Source

Fastify capture

Capture your Fastify test traffic to .har HTTP archive files.

Installation

yarn add @useoptic/fastify-capture
npm install @useoptic/fastify-capture

Setup

import { fastifyCapture } form '@useoptic/fastify-capture'

if (env === 'test') {
  fastify.addHook('onSend', fastifyCapture({
    // Determines where the captured archives will be exported
    harOutputDir: 'har-capture',

    // Set to a number between 0 and 1 to sample traffic
    sampleRate: undefined
  }));
}

Usage

The optic CLI uses the captured .har files to measure how much of your OpenAPI specification is covered by your tests 🪄

Learn more about capture and coverage in Optic's documentation.

FAQs

Package last updated on 07 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts