From d603c3c8940ef3598419e0b5817c0a027fca74ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 15:50:47 +0000 Subject: [PATCH] docs(migration): keep single as-const removal example Agent-Logs-Url: https://github.com/vitest-dev/vitest/sessions/cf1db177-91ed-4072-bbdf-c937b38dae46 Co-authored-by: sheremet-va <16173870+sheremet-va@users.noreply.github.com> --- docs/guide/migration.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/docs/guide/migration.md b/docs/guide/migration.md index e1adf34ea..52f517631 100644 --- a/docs/guide/migration.md +++ b/docs/guide/migration.md @@ -48,7 +48,7 @@ function runWithRuntimeRetry(fn: (retry: number) => void) { fn(Math.trunc(Math.random() * 10)) } -test.for([1, 2])('retry %s', (retry) => { // [!code --] +test.for([1, 2] as const)('retry %s', (retry) => { // [!code --] runWithRuntimeRetry((runtimeRetry) => { const sameType: typeof retry = runtimeRetry // ^ Type 'number' is not assignable to type '1 | 2' @@ -60,14 +60,6 @@ test.for([1, 2])('retry %s', (retry) => { // [!code ++] const sameType: typeof retry = runtimeRetry }) }) - -test.for([1, 2] as const)('retry %s', (retry) => { // [!code --] - expectTypeOf(retry).toEqualTypeOf<1 | 2>() -}) - -test.for([1, 2])('retry %s', (retry) => { // [!code ++] - expectTypeOf(retry).toEqualTypeOf<1 | 2>() -}) ``` ### Locators in Commands are Serialized as Objects -- 2.51.2