7.1.1 • Published 29 days ago

jest-expect-har v7.1.1

Weekly downloads
190
License
MIT
Repository
github
Last release
29 days 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.1

29 days ago

7.1.0

10 months ago

7.0.0

1 year ago

6.0.0

1 year ago

5.0.0

2 years ago

4.0.0

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

4 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