Skip to content

Commit 53a10d9

Browse files
committed
readme: test command
1 parent 47a3719 commit 53a10d9

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.mdown

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,20 @@ Schemas can use any of these schemas as a meta-schema (that is the schema used i
115115
Multiple meta-schemas can be passed, as in `-s` parameter.
116116

117117

118+
## Test validation result
119+
120+
This command asserts that the result of the validation is as expected.
121+
122+
```sh
123+
ajv test -s test/schema.json -d test/valid_data.json --valid
124+
ajv test -s test/schema.json -d test/invalid_data.json --invalid
125+
```
126+
127+
If the option `--valid` (`--invalid`) is used for the `test` to pass (exit code 0) the data file(s) should be valid (invalid).
128+
129+
This command supports the same options and parameters as [validate](#validate-data) with the exception of `--changes`.
130+
131+
118132
## Ajv options
119133

120134
You can pass the following Ajv options:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ajv-cli",
3-
"version": "0.7.0",
3+
"version": "0.8.0",
44
"description": "A command line interface for epoberezkin/ajv JSON schema validator",
55
"scripts": {
66
"eslint": "eslint index.js commands/*.js",

0 commit comments

Comments
 (0)