jest-expect-har

8.0.1 • Public • Published

jest-expect-har

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

npm Build

ReadMe Open Source

Installation

npm install jest-expect-har --save-dev

Usage

import toBeAValidHAR from 'jest-expect-har';
import { expect, test } from 'vitest';

expect.extend({ toBeAValidHAR });

test('should be a valid HAR', () => {
  expect(har).toBeAValidHAR();
});

test('should not be a valid HAR', () => {
  expect(invalidHar).not.toBeAValidHAR();
});

The usage is nearly identical in Jest:

import toBeAValidHAR from 'jest-expect-har';

expect.extend({ toBeAValidHAR });

test('should be a valid HAR', () => {
  expect(har).toBeAValidHAR();
});

test('should not be a valid HAR', () => {
  expect(invalidHar).not.toBeAValidHAR();
});

Package Sidebar

Install

npm i jest-expect-har

Weekly Downloads

393

Version

8.0.1

License

MIT

Unpacked Size

12 kB

Total Files

9

Last publish

Collaborators

  • gkoberger
  • domharrington
  • mjcuva
  • kanadgupta
  • jonursenbach
  • rafegoldberg
  • iliast
  • dannobytes
  • gratcliff
  • llimllib
  • darrenyong
  • azinder1
  • kellyjosephprice