Skip to content

Commit

Permalink
Delete forward tests with generic usage
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrHoroshih committed Sep 18, 2023
1 parent ad0567e commit 2600985
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions src/types/__tests__/effector/forward.test.ts
Expand Up @@ -127,42 +127,6 @@ describe('forward with subtyping', () => {
"
`)
})
it('cannot narrow type from string|number to string (should fail)', () => {
//@ts-expect-error
forward<string | number>({from: strOrNum, to: str})
expect(typecheck).toMatchInlineSnapshot(`
"
no errors
"
`)
})
it('generic to (should fail)', () => {
//@ts-expect-error
forward<string>({from: strOrNum, to: str})
expect(typecheck).toMatchInlineSnapshot(`
"
Type 'EventCallable<string | number>' is not assignable to type 'Unit<string>'.
"
`)
})
it('generics `to` and `from` (should pass)', () => {
forward<string | number, string>({to: strOrNum, from: str})
expect(typecheck).toMatchInlineSnapshot(`
"
no errors
"
`)
})
it('generics `to` and `from` (should fail on providing generics)', () => {
//@ts-expect-error
forward<string, string | number>({to: str, from: strOrNum})
expect(typecheck).toMatchInlineSnapshot(`
"
Type 'string | number' does not satisfy the constraint 'string'.
Type 'number' is not assignable to type 'string'.
"
`)
})
})

describe('any to void support', () => {
Expand Down

0 comments on commit 2600985

Please sign in to comment.