diff --git a/lib/types/errors/external-host-error.ts b/lib/types/errors/external-host-error.ts index 88f4fdb936f19f8d9c09bbc42ac654ea7176e752..5fd5922966a704f6879fe7ba79de01c2813d4606 100644 --- a/lib/types/errors/external-host-error.ts +++ b/lib/types/errors/external-host-error.ts @@ -1,7 +1,7 @@ import { EXTERNAL_HOST_ERROR } from '../../constants/error-messages'; export class ExternalHostError extends Error { - hostType: string; + hostType: string | undefined; err: Error; diff --git a/lib/util/mask.spec.ts b/lib/util/mask.spec.ts index a3150839d138d94b5ebe4642e1e897ea78e7a2dc..e7cdb0816c546436b5ab01523996bd1d0837e37f 100644 --- a/lib/util/mask.spec.ts +++ b/lib/util/mask.spec.ts @@ -2,7 +2,8 @@ import { maskToken } from './mask'; describe('util/mask', () => { describe('.maskToken', () => { - it('returns value if passed value is falsy', () => { + it('returns empty string if passed value is falsy', () => { + expect(maskToken()).toBe(''); expect(maskToken('')).toBe(''); }); diff --git a/lib/util/mask.ts b/lib/util/mask.ts index dd50d4336628d41bb514cc45fd911d3c2df4d645..83fa009a351b00edd7328288aaf1ccbdd4d2baa9 100644 --- a/lib/util/mask.ts +++ b/lib/util/mask.ts @@ -5,5 +5,5 @@ export function maskToken(str?: string): string { new Array(str.length - 3).join('*'), str.slice(-2), ].join('') - : str; + : ''; } diff --git a/test/graphql-snapshot.ts b/test/graphql-snapshot.ts index 66e7f9f3eb378db61caa52fe47f2e97fcab4a00f..75478315b40f92b9d214729e8fd34763d1913a3e 100644 --- a/test/graphql-snapshot.ts +++ b/test/graphql-snapshot.ts @@ -37,11 +37,13 @@ type Variables = Record<string, string>; interface SelectionSet { __vars?: Variables; __args?: Arguments; - [key: string]: null | SelectionSet | Arguments; + [key: string]: undefined | null | SelectionSet | Arguments; } interface GraphqlSnapshot { query?: SelectionSet; + mutation?: SelectionSet; + subscription?: SelectionSet; variables?: Record<string, string>; } @@ -81,7 +83,7 @@ function getArguments(key: string, val: ValueNode): Arguments { } function simplifyArguments( - argNodes: ReadonlyArray<ArgumentNode> + argNodes?: ReadonlyArray<ArgumentNode> ): Arguments | null { if (argNodes) { let result: Arguments = {}; diff --git a/tsconfig.strict.json b/tsconfig.strict.json index efec9fbfe0faba954cf0c239975a2846e77adedf..50bda1274807772b4df58bb328bb924af685d210 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -88,6 +88,7 @@ "./lib/platform/utils/pr-body.ts", "./lib/proxy.ts", "./lib/types/branch-status.ts", + "./lib/types/errors/external-host-error.ts", "./lib/types/git.ts", "./lib/types/host-rules.ts", "./lib/types/later.d.ts", @@ -108,12 +109,15 @@ "./lib/util/http/types.ts", "./lib/util/index.ts", "./lib/util/json-writer/indentation-type.ts", + "./lib/util/mask.spec.ts", + "./lib/util/mask.ts", "./lib/util/object.ts", "./lib/util/sanitize.ts", "./lib/util/split.ts", "./lib/workers/pr/changelog/hbs-template.ts", "./lib/workers/pr/changelog/types.ts", "./lib/workers/repository/init/types.ts", + "./test/graphql-snapshot.ts", "./test/json-schema.ts", "./test/newline-snapshot-serializer.ts", "./test/static-files.spec.ts",