Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tpetrucciani committed Jan 31, 2020
1 parent ea7ce35 commit 6178e65
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/__snapshots__/main.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ export const CreateCampingError = t.union([
}, 'OtherError')
], 'CreateCampingError')

export interface SingleCaseTaggedUnion {
x: number,
y: string,
_type: 'SingleCase'
}

export const SingleCaseTaggedUnion = t.type({
x: t.Integer,
y: t.string,
_type: t.literal('SingleCase')
}, 'SingleCase')

export type Surface =
| {
_type: 'Sand'
Expand Down
34 changes: 34 additions & 0 deletions test/source-tagged-unions.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,40 @@
],
"desc": "Surface of the camping site",
"_type": "TaggedUnion"
},
{
"name": "SingleCaseTaggedUnion",
"values": [
{
"name": "SingleCase",
"params": [
{
"name": "x",
"tpe": {
"name": "Int",
"_type": "Name"
}
},
{
"name": "y",
"tpe": {
"name": "String",
"_type": "Name"
}
}
],
"desc": "Its only case",
"isValueClass": false
}
],
"desc": "Not really much of a union",
"_type": "TaggedUnion"
},
{
"name": "ZeroCaseTaggedUnion",
"values": [],
"desc": "Nothing at all in here",
"_type": "TaggedUnion"
}
]
}

0 comments on commit 6178e65

Please sign in to comment.