Skip to content

Commit dc8c0c2

Browse files
committed
add test for #719
1 parent e22897a commit dc8c0c2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/2.1.x/union.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,15 @@ describe.concurrent('union', () => {
238238
}
239239
)
240240
})
241+
242+
it('readonly', () => {
243+
assert.strictEqual(t.getTags(t.readonly(t.strict({ a: t.string }))), t.emptyTags)
244+
assert.deepStrictEqual(t.getTags(t.readonly(t.strict({ tag: t.literal('a') }))), { tag: ['a'] })
245+
assert.deepStrictEqual(t.getTags(t.readonly(t.strict({ tag: t.literal('a'), type: t.literal('b') }))), {
246+
tag: ['a'],
247+
type: ['b']
248+
})
249+
})
241250
})
242251

243252
it('getIndex', () => {

0 commit comments

Comments
 (0)