Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
jest-schema-matcher
Advanced tools
[![npm version](https://badge.fury.io/js/jest-schema-matcher.svg)](https://badge.fury.io/js/jest-schema-matcher) ![Lint-Build-Test-Publish](https://github.com/ryparker/jest-schema-matcher/workflows/Lint-Build-Test-Publish/badge.svg) [![semantic-release](h
An opinionated Jest matcher that generates, validates, and versions JSON Schemas for your APIs.
yarn add --dev jest-schema-matcher
SHOULD_UPDATE_SCHEMAS
in your jest's global config// jest.config.js
module.exports = {
...
globals: {
SHOULD_UPDATE_SCHEMAS: true, // If true, schemas will be written/updated
}
}
test('Check against schema', () => {
const object = {
username: 'test_user_a124',
password: 'fixtures_password',
}
expect(object).toMatchSchema('schemaName')
/**
* 1. If SHOULD_UPDATE_SCHEMAS === true:
* Will create a new schema or update existing schema in same path as test file.
* E.g. If test path is `.../__tests__/sample.tests.js`
* Then schema will be created in `.../__tests__/schemas/schemaName.json`
* --or--
* If SHOULD_UPDATE_SCHEMAS === false:
* Will infer a new schema and recommend schema changes if the saved schema could be improved.
*/
/** 2. Will validate `object` against saved schema.*/
})
FAQs
[![npm version](https://badge.fury.io/js/jest-schema-matcher.svg)](https://badge.fury.io/js/jest-schema-matcher) ![Lint-Build-Test-Publish](https://github.com/ryparker/jest-schema-matcher/workflows/Lint-Build-Test-Publish/badge.svg) [![semantic-release](h
The npm package jest-schema-matcher receives a total of 4 weekly downloads. As such, jest-schema-matcher popularity was classified as not popular.
We found that jest-schema-matcher demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.