# jest-joi-schema

> Joi schema matcher for Jest

Latest version **1.0.0** (published 2019-01-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install jest-joi-schema
pnpm add jest-joi-schema
yarn add jest-joi-schema
bun add jest-joi-schema
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-01-01 |
| First published | 2019-01-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tamas Pap |
| Maintainers | tamas-pap |
| Keywords | jest, joi, schema, expect, extend |

## Links

- npm: https://www.npmjs.com/package/jest-joi-schema
- Repository: https://github.com/tamas-pap/jest-joi-schema
- Homepage: https://github.com/tamas-pap/jest-joi-schema#readme
- Issues: https://github.com/tamas-pap/jest-joi-schema/issues
- npm.io page: https://npm.io/package/jest-joi-schema

## Alternatives

- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-01-01

## README

# jest-joi-schema

[Joi](https://www.npmjs.com/package/joi) schema matcher for [Jest](https://www.npmjs.com/package/jest).

## Install via npm
```
npm install jest-joi-schema --save
```

## Usage

In any test file:

```js
import { matchers } from 'jest-joi-schema';
expect.extend(matchers);
```

or add it directly in [`setupTestFrameworkScriptFile`](https://jestjs.io/docs/en/configuration#setuptestframeworkscriptfile-string).

```js
const joi = require('joi');

const userSchema = joi.object({
  firstName: joi.string().required(),
  lastName: joi.string().required(),
  email: joi.string().email(),
});

const options = { allowUnknown: true };

expect(values).toMatchSchema(
  userSchema,
  options,
);
```

---
_Source: https://npm.io/package/jest-joi-schema · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
