New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cypress/schema-tools

Package Overview
Dependencies
Maintainers
5
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cypress/schema-tools

Validate, sanitize and document JSON schemas

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
23K
decreased by-12.3%
Maintainers
5
Weekly downloads
 
Created
Source

@cypress/schema-tools CircleCI renovate-app badge

Validate, sanitize and document JSON schemas

Motivation

Explicit JSON schemas describing objects passed in your system are good.

  • they are a living testable documentation instead of manual Wiki editing
  • provide examples for tests and integrations
  • validate inputs and outputs of the API calls

API

TODO describe current API

documentSchemas

You can document your schemas using provided method. Example code file

import { documentSchemas } from '@cypress/schema-tools'
import { schemas } from './schemas'
import { formats } from './formats'
console.log(documentSchemas(schemas, formats))

Call it from your NPM scripts

{
  "scripts": {
    "document": "ts-node ./document.ts > schemas.md"
  },
  "devDependencies": {
    "ts-node": "5.0.1",
    "typescript": "2.8.1"
  }
}

Testing

Uses ava-ts to run Ava test runner directly against TypeScript test files. Use npm t to build and test everything in the test folder.

To run a single test file, use command

npx ava-ts test/<file-name.ts>

To update snapshots and use verbose reporter (prints test names)

npx ava-ts test/<file-name.ts> --verbose -u

License

This project is licensed under the terms of the MIT license.

Keywords

FAQs

Package last updated on 18 Apr 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc