Skip to content

Commit c43f1ff

Browse files
committed
test: update assertions
1 parent c07b7ef commit c43f1ff

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

pnpm-lock.yaml

Lines changed: 2 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/experimental.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,26 +181,26 @@ describe('experimental: type-level RegExp match for type safe match results', ()
181181
]
182182
`)
183183
expectTypeOf(matchResult?._matchArray).toEqualTypeOf<
184-
['bazqux', 'bazqux', 'baz'] | ['barqux', 'barqux', 'bar'] | undefined
184+
['barqux', 'barqux', 'bar']
185185
>()
186186

187187
expect(matchResult?.[0]).toMatchInlineSnapshot('"barqux"')
188-
expectTypeOf(matchResult?.[0]).toEqualTypeOf<'bazqux' | 'barqux' | undefined>()
188+
expectTypeOf(matchResult?.[0]).toEqualTypeOf<'barqux'>()
189189

190190
expect(matchResult?.[1]).toMatchInlineSnapshot('"barqux"')
191-
expectTypeOf(matchResult?.[1]).toEqualTypeOf<'bazqux' | 'barqux' | undefined>()
191+
expectTypeOf(matchResult?.[1]).toEqualTypeOf<'barqux'>()
192192

193193
expect(matchResult?.[2]).toMatchInlineSnapshot('"bar"')
194-
expectTypeOf(matchResult?.[2]).toEqualTypeOf<'bar' | 'baz' | undefined>()
194+
expectTypeOf(matchResult?.[2]).toEqualTypeOf<'bar'>()
195195

196196
// @ts-expect-error - Element implicitly has an 'any' type because expression of type '3' can't be used to index
197197
expect(matchResult?.[3]).toMatchInlineSnapshot('undefined')
198198

199199
expect(matchResult?.index).toMatchInlineSnapshot('1')
200-
expectTypeOf(matchResult?.index).toEqualTypeOf<number | undefined>()
200+
expectTypeOf(matchResult?.index).toEqualTypeOf<1>()
201201

202202
expect(matchResult?.length).toMatchInlineSnapshot('3')
203-
expectTypeOf(matchResult?.length).toEqualTypeOf<3 | undefined>()
203+
expectTypeOf(matchResult?.length).toEqualTypeOf<3>()
204204

205205
expect(matchResult?.groups).toMatchInlineSnapshot(`
206206
{
@@ -209,7 +209,7 @@ describe('experimental: type-level RegExp match for type safe match results', ()
209209
}
210210
`)
211211
expectTypeOf(matchResult?.groups).toEqualTypeOf<
212-
{ g1: 'bar' | 'baz', g2: 'bazqux' | 'barqux' } | undefined
212+
{ g1: 'bar', g2: 'barqux' }
213213
>()
214214
})
215215
})

0 commit comments

Comments
 (0)