You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a testing engineer I want to be able to write test cases that only include type tests.
Example test:
import{assertType,expectTypeOf,describe,it}from'vitest'import{mount}from'./types.s'describe('',()=>{it('my types work properly',()=>{.// 👈 this is failing because of a violation of `vitest/expect-expect`expectTypeOf(mount).toBeFunction()expectTypeOf(mount).parameter(0).toMatchTypeOf<{name: string}>()// @ts-expect-error name is a stringassertType(mount({name: 42}))})})
A test case containing only expectTypeOf should pass the vitest/expect-expect rule
Minimal reproduction of current behaviour
import{assertType,expectTypeOf,describe,it}from'vitest'import{mount}from'./types.s'describe('',()=>{// eslint-disable-next-line vitest/expect-expect // 👈 needed to pass lint targetit('my types work properly',()=>{expectTypeOf(mount).toBeFunction()expectTypeOf(mount).parameter(0).toMatchTypeOf<{name: string}>()// @ts-expect-error name is a stringassertType(mount({name: 42}))})})
Desired behaviour showcase
import{assertType,expectTypeOf,describe,it}from'vitest'import{mount}from'./types.s'describe('',()=>{it('my types work properly',()=>{// 👈 lint target passed without disabling rulesexpectTypeOf(mount).toBeFunction()expectTypeOf(mount).parameter(0).toMatchTypeOf<{name: string}>()// @ts-expect-error name is a stringassertType(mount({name: 42}))})})
Which configuration is this related to?
vitest
ESLint version
No response
The text was updated successfully, but these errors were encountered:
User story
As a testing engineer I want to be able to write test cases that only include type tests.
Example test:
This violates the vitest/expect-expect rule in the current configuration.
Acceptance criteria
expectTypeOf
should pass thevitest/expect-expect
ruleMinimal reproduction of current behaviour
Desired behaviour showcase
Which configuration is this related to?
vitest
ESLint version
No response
The text was updated successfully, but these errors were encountered: