You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

jest-expect-openapi

Package Overview
Dependencies
Maintainers
12
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-expect-openapi

Jest/Vitest matcher for asserting valid OpenAPI definitions

4.0.1
latest
Source
npmnpm
Version published
Weekly downloads
693
-41.52%
Maintainers
12
Weekly downloads
 
Created
Source

jest-expect-openapi

A Vitest and Jest custom matcher for asserting valid OpenAPI definitions.

npm Build

ReadMe Open Source

Installation

npm install jest-expect-openapi --save-dev

Usage

import toBeAValidOpenAPIDefinition from 'jest-expect-openapi';
import { expect, test } from 'vitest';

expect.extend({ toBeAValidOpenAPIDefinition });

test('should be a valid OpenAPI definition', () => {
  expect(oas).toBeAValidOpenAPIDefinition();
});

test('should not be a valid OpenAPI definition', () => {
  expect(invalidOas).not.toBeAValidOpenAPIDefinition();
});

The usage is nearly identical in Jest:

import toBeAValidOpenAPIDefinition from 'jest-expect-openapi';

expect.extend({ toBeAValidOpenAPIDefinition });

test('should be a valid OpenAPI definition', () => {
  expect(oas).toBeAValidOpenAPIDefinition();
});

test('should not be a valid OpenAPI definition', () => {
  expect(invalidOas).not.toBeAValidOpenAPIDefinition();
});

Keywords

jest

FAQs

Package last updated on 04 Aug 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.