npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

json-schema-test-suite

v0.0.10

Published

Exposes JSON Schema Test Suite as a Node.js package

Downloads

5,758

Readme

JSON Schema Test Suite Build Status

** This is the node branch of JSON Schema Test Suite.**

Node-specific support is maintained on GitHub on the node branch. See NODE-README.md for more information on using this package.

This repository contains a set of JSON objects that implementors of JSON Schema validation libraries can use to test their validators.

It is meant to be language agnostic and should require only a JSON parser.

The conversion of the JSON objects into tests within your test framework of choice is still the job of the validator implementor.

Structure of a Test

If you're going to use this suite, you need to know how tests are laid out. The tests are contained in the tests directory at the root of this repository.

Inside that directory is a subdirectory for each draft or version of the schema. We'll use draft3 as an example.

If you look inside the draft directory, there are a number of .json files, which logically group a set of test cases together. Often the grouping is by property under test, but not always, especially within optional test files (discussed below).

Inside each .json file is a single array containing objects. It's easiest to illustrate the structure of these with an example:

    {
        "description": "the description of the test case",
        "schema": {"the schema that should" : "be validated against"},
        "tests": [
            {
                "description": "a specific test of a valid instance",
                "data": "the instance",
                "valid": true
            },
            {
                "description": "another specific test this time, invalid",
                "data": 15,
                "valid": false
            }
        ]
    }

So a description, a schema, and some tests, where tests is an array containing one or more objects with descriptions, data, and a boolean indicating whether they should be valid or invalid.

Coverage

Draft 3 and 4 should have full coverage. If you see anything missing or think there is a useful test missing, please send a pull request or open an issue.

Who Uses the Test Suite

This suite is being used by:

Coffeescript

Dart

Erlang

Go

Haskell

Java

JavaScript

Node.js

The JSON Schema Test Suite is also available as an npm package. Node-specific support is maintained on the node branch. See NODE-README.md for more information.

.NET

PHP

Python

Ruby

Rust

Swift

If you use it as well, please fork and send a pull request adding yourself to the list :).

Contributing

If you see something missing or incorrect, a pull request is most welcome!

There are some sanity checks in place for testing the test suite. You can run them with bin/jsonschema_suite check. They will be run automatically by Travis CI as well.