Skip to content

Commit

Permalink
Add tests for $defs and const normalizers
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed May 7, 2020
1 parent 10426f3 commit 50d9b4c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/__snapshots__/test/test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -10898,3 +10898,25 @@ Generated by [AVA](https://avajs.dev).
[k: string]: any;␊
}␊
`

## Normalize $defs to definitions

> Snapshot 1
`{␊
"id": "foo",␊
"definitions": {␊
"bar": "baz"␊
}␊
}`

## Normalize const to singleton enum

> Snapshot 1
`{␊
"id": "foo",␊
"enum": [␊
"foobar"␊
]␊
}`
Binary file modified test/__snapshots__/test/test.ts.snap
Binary file not shown.
11 changes: 11 additions & 0 deletions test/normalizer/constToEnum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Normalize const to singleton enum",
"in": {
"id": "foo",
"const": "foobar"
},
"out": {
"id": "foo",
"enum": ["foobar"]
}
}
15 changes: 15 additions & 0 deletions test/normalizer/defsToDefinitions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Normalize $defs to definitions",
"in": {
"id": "foo",
"$defs" : {
"bar": "baz"
}
},
"out": {
"id": "foo",
"definitions" : {
"bar": "baz"
}
}
}

0 comments on commit 50d9b4c

Please sign in to comment.