From dcfad60120998bd9b1da1e367fbe3de9a25c3126 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Sun, 11 Aug 2024 09:25:40 -0700 Subject: [PATCH] Remove :unknown from tests --- ....ts => ContextValueTypedAsNever.invalid.ts} | 2 +- ...ontextValueTypedAsNever.invalid.ts.expected | 18 ++++++++++++++++++ .../ContextValueTypedAsNever.ts.expected | 18 ------------------ .../ContextValueTypedAsString.invalid.ts | 2 +- ...ntextValueTypedAsString.invalid.ts.expected | 8 ++++---- 5 files changed, 24 insertions(+), 24 deletions(-) rename src/tests/fixtures/resolver_context/{ContextValueTypedAsNever.ts => ContextValueTypedAsNever.invalid.ts} (65%) create mode 100644 src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected delete mode 100644 src/tests/fixtures/resolver_context/ContextValueTypedAsNever.ts.expected diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.ts b/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts similarity index 65% rename from src/tests/fixtures/resolver_context/ContextValueTypedAsNever.ts rename to src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts index e898ac7f..69ad853f 100644 --- a/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.ts +++ b/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts @@ -1,7 +1,7 @@ /** @gqlType */ export class SomeType { /** @gqlField */ - greeting(args: unknown, ctx: never): string { + greeting(ctx: never): string { return ctx.greeting; } } diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected b/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected new file mode 100644 index 00000000..095747c9 --- /dev/null +++ b/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts.expected @@ -0,0 +1,18 @@ +----------------- +INPUT +----------------- +/** @gqlType */ +export class SomeType { + /** @gqlField */ + greeting(ctx: never): string { + return ctx.greeting; + } +} + +----------------- +OUTPUT +----------------- +src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts:4:17 - error: Unexpected `never` type for resolver argument. If a resolver argument is not needed by the resolver, it may be omitted. + +4 greeting(ctx: never): string { + ~~~~~ diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.ts.expected b/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.ts.expected deleted file mode 100644 index b9c22106..00000000 --- a/src/tests/fixtures/resolver_context/ContextValueTypedAsNever.ts.expected +++ /dev/null @@ -1,18 +0,0 @@ ------------------ -INPUT ------------------ -/** @gqlType */ -export class SomeType { - /** @gqlField */ - greeting(args: unknown, ctx: never): string { - return ctx.greeting; - } -} - ------------------ -OUTPUT ------------------ -src/tests/fixtures/resolver_context/ContextValueTypedAsNever.ts:4:18 - error: Unexpected `unknown` type for resolver argument. If a resolver argument is not needed by the resolver, it may be omitted. - -4 greeting(args: unknown, ctx: never): string { - ~~~~~~~ diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts b/src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts index 868fd9bd..ccd71d45 100644 --- a/src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts +++ b/src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts @@ -1,7 +1,7 @@ /** @gqlType */ export class SomeType { /** @gqlField */ - greeting(args: unknown, ctx: string): string { + greeting(ctx: string): string { return ctx; } } diff --git a/src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts.expected b/src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts.expected index 8fcef38b..3091d767 100644 --- a/src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts.expected +++ b/src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts.expected @@ -4,7 +4,7 @@ INPUT /** @gqlType */ export class SomeType { /** @gqlField */ - greeting(args: unknown, ctx: string): string { + greeting(ctx: string): string { return ctx; } } @@ -12,7 +12,7 @@ export class SomeType { ----------------- OUTPUT ----------------- -src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts:4:18 - error: Unexpected `unknown` type for resolver argument. If a resolver argument is not needed by the resolver, it may be omitted. +src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts:4:17 - error: Unexpected type for resolver argument. Resolver arguments must be typed with either an object literal (`{}`) or a reference to a named type. -4 greeting(args: unknown, ctx: string): string { - ~~~~~~~ +4 greeting(ctx: string): string { + ~~~~~~