Skip to content
Snippets Groups Projects
Commit 50ad7e9e authored by Alvaro Cabrera Durán's avatar Alvaro Cabrera Durán
Browse files

Update TESTING info

parent 241cecce
No related branches found
No related tags found
No related merge requests found
## Testing
**JSON-Schema-Faker** has performs two types of testing: unit and schema.
**JSON-Schema-Faker** performs two types of testing: unit and schema.
### Unit tests
- They just validate the building blocks from the entire library
- We're using `mocha` and `chai` so the worflow would be very familiar
> Much stuff from the internals are not covered by unit-tests yet, PRs for increasing that are very welcome!
----
### Schema tests
......@@ -49,15 +52,16 @@ The properties below are used to setup the test and execute the assertions:
- `refs` — are for resolving used `$ref`'s on the faked schema
- `throws` — test if the an error was expected, can be a boolean or string
- `hasNot` — used for primitives, it will perform a `not.toContain()` test
- `hasProps` —
- `onlyProps` —
- `hasProps` — ensure given props exists on the generated value
- `onlyProps` — ensure given props matches the generated value
- `type` — used for primitives, it will perform a `toHaveType()` test
- `valid` — will test the generated json against the original schema
- `equal` — will test equality for the given schema and the generated one
- `repeat` — will execute the same test many times as given
- `seed` —
- `set` —
- `skip` —
- `only` —
- `count` —
- `length` —
- `seed` — provide the given seed to the `random()` generator
- `count` — will match arrays/strings length or object props, etc.
- `set` — configure given options through `jsf.option()`
- `skip` — skip individual tests
- `only` — run this test only
> Use these tests as reference of how things works, if you found an edge-case please add it as test and open an issue for.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment