Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including jest-joi with all npm packages installed. Try it out:

/* This demo contains a barebones test runner that emulates the basic features of Jest. For full functionality, install `jest-joi` locally in your project. See npmjs.com/package/jest-joi for setup instructions. */ // The following line is only for this demo β€”Β don't include it in your project. const { test, expect } = require("jest-joi").demo("runkit"); // Hit "run" below to see some results! // You can also copy over examples from the documentation. const Joi = require("joi"); // This one will pass! πŸŽ‰ test("A string should match its schema", () => { const schema = Joi.string(); const value = "Hello!"; expect(value).toMatchSchema(schema); }); // But this one will fail πŸ˜” test("An object should match its schema", () => { const schema = { a: Joi.string() }; const value = { a: false }; expect(value).toMatchSchema(schema); }); ("See npmjs.com/package/jest-joi for more examples and setup instructions.");

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

jest-joi v1.1.17

Jest matcher for Joi schemas

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free