From c43f1ff8afd15e8a9a8c260d98e2d8a60fc10019 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 7 Mar 2024 00:16:02 +0000 Subject: [PATCH] test: update assertions --- pnpm-lock.yaml | 11 ++--------- test/experimental.test.ts | 14 +++++++------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f9c1e626..40e8bda9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1189,7 +1189,7 @@ packages: ajv: 6.12.6 debug: 4.3.4 espree: 9.6.1 - globals: 13.23.0 + globals: 13.24.0 ignore: 5.3.1 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -5054,7 +5054,7 @@ packages: file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.23.0 + globals: 13.24.0 graphemer: 1.4.0 ignore: 5.3.1 imurmurhash: 0.1.4 @@ -5475,18 +5475,11 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - /globals@13.23.0: - resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.20.2 - /globals@13.24.0: resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 - dev: true /globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} diff --git a/test/experimental.test.ts b/test/experimental.test.ts index 37b49f02..18740527 100644 --- a/test/experimental.test.ts +++ b/test/experimental.test.ts @@ -181,26 +181,26 @@ describe('experimental: type-level RegExp match for type safe match results', () ] `) expectTypeOf(matchResult?._matchArray).toEqualTypeOf< - ['bazqux', 'bazqux', 'baz'] | ['barqux', 'barqux', 'bar'] | undefined + ['barqux', 'barqux', 'bar'] >() expect(matchResult?.[0]).toMatchInlineSnapshot('"barqux"') - expectTypeOf(matchResult?.[0]).toEqualTypeOf<'bazqux' | 'barqux' | undefined>() + expectTypeOf(matchResult?.[0]).toEqualTypeOf<'barqux'>() expect(matchResult?.[1]).toMatchInlineSnapshot('"barqux"') - expectTypeOf(matchResult?.[1]).toEqualTypeOf<'bazqux' | 'barqux' | undefined>() + expectTypeOf(matchResult?.[1]).toEqualTypeOf<'barqux'>() expect(matchResult?.[2]).toMatchInlineSnapshot('"bar"') - expectTypeOf(matchResult?.[2]).toEqualTypeOf<'bar' | 'baz' | undefined>() + expectTypeOf(matchResult?.[2]).toEqualTypeOf<'bar'>() // @ts-expect-error - Element implicitly has an 'any' type because expression of type '3' can't be used to index expect(matchResult?.[3]).toMatchInlineSnapshot('undefined') expect(matchResult?.index).toMatchInlineSnapshot('1') - expectTypeOf(matchResult?.index).toEqualTypeOf() + expectTypeOf(matchResult?.index).toEqualTypeOf<1>() expect(matchResult?.length).toMatchInlineSnapshot('3') - expectTypeOf(matchResult?.length).toEqualTypeOf<3 | undefined>() + expectTypeOf(matchResult?.length).toEqualTypeOf<3>() expect(matchResult?.groups).toMatchInlineSnapshot(` { @@ -209,7 +209,7 @@ describe('experimental: type-level RegExp match for type safe match results', () } `) expectTypeOf(matchResult?.groups).toEqualTypeOf< - { g1: 'bar' | 'baz', g2: 'bazqux' | 'barqux' } | undefined + { g1: 'bar', g2: 'barqux' } >() }) })