Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

justusbluemer/jest-joi-schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

jest-joi-schema

Joi schema matcher for Jest.

Install via npm

npm install jest-joi-schema --save

Usage

In any test file:

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

or add it directly in setupTestFrameworkScriptFile.

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,
);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published