Skip to content

Commit

Permalink
✨ bump ajv version to 6.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
up9cloud committed Jan 22, 2019
1 parent 84ba268 commit 372c79c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is based on [ajv](https://github.com/epoberezkin/ajv), a JSON schema Valida
|---|---|---|
|[v1](https://github.com/up9cloud/chai-json-schema-ajv/tree/v1)|4.11.8|[JSON Schema draft 4](http://json-schema.org/)|
|[v2](https://github.com/up9cloud/chai-json-schema-ajv/tree/v2)|5.5.2|[JSON Schema draft-06](https://trac.tools.ietf.org/html/draft-wright-json-schema-validation-01)|
|v3|6.1.1|[JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html)|
|v3|6.7.0|[JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html)|

## Usage

Expand Down Expand Up @@ -83,21 +83,25 @@ expect(schema).to.be.validJsonSchema
### With custom ajv options

```js
...
const options = { ... }
chai.use(require('chai-json-schema-ajv').withOptions(options))

chai.use(
require('chai-json-schema-ajv').withOptions(options)
)
...
```

- options will be send to [ajv](https://github.com/epoberezkin/ajv#options)

## Verbose

> Default error message is parsed by `ajv.errorsText`.
Default error message is parsed by `ajv.errorsText`.

```js
...
chai.use(require('chai-json-schema-ajv')
chai.use(
require('chai-json-schema-ajv')
)
...
```

Expand All @@ -106,11 +110,15 @@ expected value not match the json-schema
data.value should be integer
```

> It will print full errors with the option `{verbose: true}`
If you go with option `{verbose: true}`, itt will print full errors.

```js
...
chai.use(require('chai-json-schema-ajv').withOptions({ verbose: true }))
chai.use(
require('chai-json-schema-ajv').withOptions({
verbose: true
})
)
...
```

Expand Down Expand Up @@ -138,7 +146,7 @@ expected value not match the json-schema

- support browser side
- move to es2017 async/await
- ~~add lint~~
- ~~add linter~~
- ~~send option to ajv~~ (thanks @dimac)

## License
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "test"
},
"dependencies": {
"ajv": "^6.1.1"
"ajv": "^6.7.0"
},
"devDependencies": {
"chai": "^4.1.2",
Expand Down

0 comments on commit 372c79c

Please sign in to comment.