Skip to content

Commit

Permalink
Update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrHoroshih committed Sep 18, 2023
1 parent 4257f07 commit ad0567e
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 44 deletions.
7 changes: 5 additions & 2 deletions src/types/__tests__/effector/fork.test.ts
Expand Up @@ -144,8 +144,11 @@ describe('fork values', () => {
Type '[StoreWritable<number>, number] | [StoreWritable<string>, string]' is not assignable to type 'readonly [StoreWritable<number>, number]'.
Type '[StoreWritable<string>, string]' is not assignable to type 'readonly [StoreWritable<number>, number]'.
Type at position 0 in source is not compatible with type at position 0 in target.
Type 'StoreWritable<string>' is not assignable to type 'StoreWritable<number>'.
Type 'string' is not assignable to type 'number'.
The types of 'on' are incompatible between these types.
Type '{ <E>(trigger: Unit<E>, reducer: (state: string, payload: E) => string | void): StoreWritable<string>; <E>(triggers: Unit<E>[], reducer: (state: string, payload: E) => string | void): StoreWritable<...>; <E extends Tuple<...>>(triggers: E, reducer: (state: string, payload: InferValueFromTupleOfUnits<...>) => string ...' is not assignable to type '{ <E>(trigger: Unit<E>, reducer: (state: number, payload: E) => number | void): StoreWritable<number>; <E>(triggers: Unit<E>[], reducer: (state: number, payload: E) => number | void): StoreWritable<...>; <E extends Tuple<...>>(triggers: E, reducer: (state: number, payload: InferValueFromTupleOfUnits<...>) => number ...'.
Types of parameters 'reducer' and 'reducer' are incompatible.
Types of parameters 'state' and 'state' are incompatible.
Type 'string' is not assignable to type 'number'.
"
`)
})
Expand Down
38 changes: 10 additions & 28 deletions src/types/__tests__/effector/forward.test.ts
Expand Up @@ -132,11 +132,7 @@ describe('forward with subtyping', () => {
forward<string | number>({from: strOrNum, to: str})
expect(typecheck).toMatchInlineSnapshot(`
"
Type 'EventCallable<string>' is not assignable to type 'UnitTarget<string | number> | readonly UnitTarget<string | number>[]'.
Type 'EventCallable<string>' is not assignable to type 'EventCallable<string | number>'.
Types of parameters 'payload' and 'payload' are incompatible.
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
no errors
"
`)
})
Expand Down Expand Up @@ -219,21 +215,17 @@ describe('any to void support', () => {
Type 'EventCallable<string>' is not assignable to type 'Unit<void>'.
Types of property '__' are incompatible.
Type 'string' is not assignable to type 'void'.
Type 'EventCallable<string>' is not assignable to type 'UnitTarget<void>'.
Type 'EventCallable<string>' is not assignable to type 'EventCallable<void>'.
Types of property 'prepend' are incompatible.
Types of parameters 'fn' and 'fn' are incompatible.
Type 'void' is not assignable to type 'string'.
Type 'EventCallable<string>' is not assignable to type 'UnitTargetable<void>'.
Types of property '__' are incompatible.
Type 'string' is not assignable to type 'void'.
No overload matches this call.
The last overload gave the following error.
Type 'EventCallable<string>' is not assignable to type 'Unit<void>'.
Types of property '__' are incompatible.
Type 'string' is not assignable to type 'void'.
Type 'EventCallable<string>' is not assignable to type 'UnitTarget<void>'.
Type 'EventCallable<string>' is not assignable to type 'EventCallable<void>'.
Types of property 'prepend' are incompatible.
Types of parameters 'fn' and 'fn' are incompatible.
Type 'void' is not assignable to type 'string'.
Type 'EventCallable<string>' is not assignable to type 'UnitTargetable<void>'.
Types of property '__' are incompatible.
Type 'string' is not assignable to type 'void'.
"
`)
})
Expand Down Expand Up @@ -298,18 +290,8 @@ test('edge case #1 (should fail)', () => {
"
No overload matches this call.
The last overload gave the following error.
Type 'EventCallable<string>' is not assignable to type 'Unit<{ value: { value: string; }; }>'.
Types of property '__' are incompatible.
Type 'string' is not assignable to type '{ value: { value: string; }; }'.
Type 'Event<{ value: { value: string; }; }>' is not assignable to type 'UnitTarget<{ value: { value: string; }; }> | readonly UnitTarget<{ value: { value: string; }; }>[]'.
Property 'prepend' is missing in type 'Event<{ value: { value: string; }; }>' but required in type 'EventCallable<{ value: { value: string; }; }>'.
No overload matches this call.
The last overload gave the following error.
Type 'EventCallable<string>' is not assignable to type 'Unit<{ value: { value: string; }; }>'.
Types of property '__' are incompatible.
Type 'string' is not assignable to type '{ value: { value: string; }; }'.
Type 'Event<{ value: { value: string; }; }>' is not assignable to type 'UnitTarget<{ value: { value: string; }; }> | readonly UnitTarget<{ value: { value: string; }; }>[]'.
Property 'prepend' is missing in type 'Event<{ value: { value: string; }; }>' but required in type 'EventCallable<{ value: { value: string; }; }>'.
Type 'Event<{ value: { value: string; }; }>' is not assignable to type 'UnitTargetable<unknown> | readonly UnitTargetable<unknown>[]'.
Type 'Event<{ value: { value: string; }; }>' is missing the following properties from type 'readonly UnitTargetable<unknown>[]': length, concat, join, slice, and 24 more.
"
`)
})
Expand Down Expand Up @@ -365,7 +347,7 @@ describe('array support', () => {
The last overload gave the following error.
Type 'EventCallable<number>' is not assignable to type 'UnitTargetable<string>'.
Types of property '__' are incompatible.
Type 'number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
"
`)
})
Expand Down
Expand Up @@ -1065,12 +1065,16 @@ const typecheck = '{global}'
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"source should extend target type\\"; targets: { sourceType: (string | number)[]; targetType: [number]; }[]; }'.
Argument of type '{ source: (StoreWritable<number> | StoreWritable<string>)[]; target: EventCallable<[number, string]>[]; }' is not assignable to parameter of type '{ error: \\"source should extend target type\\"; targets: { sourceType: (string | number)[]; targetType: [number, string]; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"source should extend target type\\"; targets: { sourceType: (string | number)[]; targetType: [number, string]; }[]; }'.
Argument of type '{ source: (StoreWritable<number> | StoreWritable<string>)[]; target: (EventCallable<[number]> | EventCallable<[number, string]>)[]; }' is not assignable to parameter of type '{ error: \\"source should extend target type\\"; targets: { sourceType: (string | number)[]; targetType: [number, string] | [number]; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"source should extend target type\\"; targets: { sourceType: (string | number)[]; targetType: [number, string] | [number]; }[]; }'.
Argument of type '{ source: readonly [StoreWritable<number>, StoreWritable<string>]; target: EventCallable<[number]>[]; }' is not assignable to parameter of type '{ error: \\"source should extend target type\\"; targets: { sourceType: readonly [number, string]; targetType: [number]; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"source should extend target type\\"; targets: { sourceType: readonly [number, string]; targetType: [number]; }[]; }'.
Argument of type '{ source: (StoreWritable<number> | StoreWritable<string>)[]; clock: EventCallable<number>; target: EventCallable<[number]>[]; }' is not assignable to parameter of type '{ error: \\"source should extend target type\\"; targets: { sourceType: (string | number)[]; targetType: [number]; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"source should extend target type\\"; targets: { sourceType: (string | number)[]; targetType: [number]; }[]; }'.
Argument of type '{ source: (StoreWritable<number> | StoreWritable<string>)[]; clock: EventCallable<number>; target: EventCallable<[number, string]>[]; }' is not assignable to parameter of type '{ error: \\"source should extend target type\\"; targets: { sourceType: (string | number)[]; targetType: [number, string]; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"source should extend target type\\"; targets: { sourceType: (string | number)[]; targetType: [number, string]; }[]; }'.
Argument of type '{ source: (StoreWritable<number> | StoreWritable<string>)[]; clock: EventCallable<number>; target: (EventCallable<[number]> | EventCallable<...>)[]; }' is not assignable to parameter of type '{ error: \\"source should extend target type\\"; targets: { sourceType: (string | number)[]; targetType: [number, string] | [number]; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"source should extend target type\\"; targets: { sourceType: (string | number)[]; targetType: [number, string] | [number]; }[]; }'.
Argument of type '{ source: readonly [StoreWritable<number>, StoreWritable<string>]; clock: EventCallable<number>; target: EventCallable<[number]>[]; }' is not assignable to parameter of type '{ error: \\"source should extend target type\\"; targets: { sourceType: readonly [number, string]; targetType: [number]; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"source should extend target type\\"; targets: { sourceType: readonly [number, string]; targetType: [number]; }[]; }'.
"
Expand Down Expand Up @@ -1279,10 +1283,14 @@ const typecheck = '{global}'
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"fn result should extend target type\\"; targets: { fnResult: { a: string | number; b: string | number; }; targetType: AN; }[]; }'.
Argument of type '{ source: (StoreWritable<number> | StoreWritable<string>)[]; target: EventCallable<AB>[]; fn: ([a, b]: (string | number)[]) => { a: string | number; b: string | number; }; }' is not assignable to parameter of type '{ error: \\"fn result should extend target type\\"; targets: { fnResult: { a: string | number; b: string | number; }; targetType: AB; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"fn result should extend target type\\"; targets: { fnResult: { a: string | number; b: string | number; }; targetType: AB; }[]; }'.
Argument of type '{ source: (StoreWritable<number> | StoreWritable<string>)[]; target: (EventCallable<AN> | EventCallable<AB>)[]; fn: ([a, b]: (string | number)[]) => { ...; }; }' is not assignable to parameter of type '{ error: \\"fn result should extend target type\\"; targets: { fnResult: { a: string | number; b: string | number; }; targetType: AN; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"fn result should extend target type\\"; targets: { fnResult: { a: string | number; b: string | number; }; targetType: AN; }[]; }'.
Argument of type '{ source: (StoreWritable<number> | StoreWritable<string>)[]; clock: EventCallable<number>; target: EventCallable<AN>[]; fn: ([a, b]: (string | number)[]) => { ...; }; }' is not assignable to parameter of type '{ error: \\"fn result should extend target type\\"; targets: { fnResult: { a: string | number; b: string | number; }; targetType: AN; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"fn result should extend target type\\"; targets: { fnResult: { a: string | number; b: string | number; }; targetType: AN; }[]; }'.
Argument of type '{ source: (StoreWritable<number> | StoreWritable<string>)[]; clock: EventCallable<number>; target: EventCallable<AB>[]; fn: ([a, b]: (string | number)[]) => { ...; }; }' is not assignable to parameter of type '{ error: \\"fn result should extend target type\\"; targets: { fnResult: { a: string | number; b: string | number; }; targetType: AB; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"fn result should extend target type\\"; targets: { fnResult: { a: string | number; b: string | number; }; targetType: AB; }[]; }'.
Argument of type '{ source: (StoreWritable<number> | StoreWritable<string>)[]; clock: EventCallable<number>; target: (EventCallable<AN> | EventCallable<...>)[]; fn: ([a, b]: (string | number)[]) => { ...; }; }' is not assignable to parameter of type '{ error: \\"fn result should extend target type\\"; targets: { fnResult: { a: string | number; b: string | number; }; targetType: AN; }[]; }'.
Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\"fn result should extend target type\\"; targets: { fnResult: { a: string | number; b: string | number; }; targetType: AN; }[]; }'.
"
`)
})
Expand Down

0 comments on commit ad0567e

Please sign in to comment.