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