7.1.0 • Published 3 months ago

jest-expect-har v7.1.0

Weekly downloads
190
License
MIT
Repository
github
Last release
3 months ago

jest-expect-har

A Jest custom matcher for asserting valid HAR definitions. Also supports Vitest.

npm Build

Installation

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

Usage

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();
});

The usage is nearly identical in Vitest:

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();
});
7.1.0

3 months ago

7.0.0

7 months ago

6.0.0

11 months ago

5.0.0

2 years ago

4.0.0

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago