Skip to content

Commit e991828

Browse files
committed
Plus side-effects
1 parent bb4f07a commit e991828

File tree

3 files changed

+1751
-2316
lines changed

3 files changed

+1751
-2316
lines changed

reports/json-gate-side-effects.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# [`json-gate`](https://github.com/oferei/json-gate#readme) side-effects in testrun
2+
3+
When running tests [`json-gate`](https://github.com/oferei/json-gate#readme) mutated either the original schema or the data being validated with the schema or both.
4+
5+
6+
# Side-effect on data
7+
[`json-gate`](https://github.com/oferei/json-gate#readme) had a side-effect on (altered the original) data in the test `Default value: 'foo' as number, Valid if not present`
8+
## Schema
9+
```js
10+
{
11+
"properties": {
12+
"foo": {
13+
"default": "foo"
14+
}
15+
}
16+
}
17+
```
18+
## Original data
19+
```js
20+
{}
21+
```
22+
## Data after validating with schema
23+
```js
24+
{
25+
"foo": "foo"
26+
}
27+
```
28+
29+
# Side-effect on data
30+
[`json-gate`](https://github.com/oferei/json-gate#readme) had a side-effect on (altered the original) data in the test `root pointer ref, mismatch`
31+
## Schema
32+
```js
33+
{
34+
"properties": {
35+
"foo": {
36+
"$ref": "#"
37+
}
38+
},
39+
"additionalProperties": false
40+
}
41+
```
42+
## Original data
43+
```js
44+
{
45+
"bar": false
46+
}
47+
```
48+
## Data after validating with schema
49+
```js
50+
{
51+
"bar": false,
52+
"foo": "foo"
53+
}
54+
```
55+
56+
# Side-effect on data
57+
[`json-gate`](https://github.com/oferei/json-gate#readme) had a side-effect on (altered the original) data in the test `required default validation, not required by default`
58+
## Schema
59+
```js
60+
{
61+
"properties": {
62+
"foo": {}
63+
}
64+
}
65+
```
66+
## Original data
67+
```js
68+
{}
69+
```
70+
## Data after validating with schema
71+
```js
72+
{
73+
"foo": "foo"
74+
}
75+
```
76+
77+
[back to benchmarks](https://github.com/ebdrup/json-schema-benchmark)

0 commit comments

Comments
 (0)