data-def-standart-ajv-mocha-test

1.0.1 • Public • Published

data-def-standart-ajv-mocha-test

Mocha tests for data-def-standart-ajv schemas and values

Example of usage

const dataDefMochaTest = require("data-def-standart-ajv-mocha-test");

const schemaVer = {
    schema: {
        type: ["string", "array"],
        contains: {
            type: "string"
        }
    },
    validValues: ["sdasfa  asda", ["asd", "dsad"], [12, 13]],
    invalidValues: [null, 12, { k: "v" }, [12, 13]],
}
dataDefMochaTest.testSchema(schemaVer); //run tests for schemaVer

const valueVer = {
    schema: {
        type: "null"
    },
    value: null,
}
dataDefMochaTest.testValue(valueVer); //run tests for valueVer

Api

module.exports = {
    testSchema: ... //function of type (schemaVersion) => void, that runs mocha tests of schemaVersion,
    //where schemaVersion is schemaVersion from package "data-def-standart-ajv"
    testValue: ... //function of type (valueVersion) => void, that runs mocha tests of valueVersion,
    //where valueVersion is valueVersion from package "data-def-standart-ajv"
}

License

MIT

Author

Anatoly Starodubtsev

Readme

Keywords

none

Package Sidebar

Install

npm i data-def-standart-ajv-mocha-test

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

11.4 kB

Total Files

5

Last publish

Collaborators

  • pantagruel74