From f96d23c9d0b8ddeff3874fedcca9fd1a45ee37a9 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Sat, 29 Jun 2024 00:50:33 +0000 Subject: [PATCH 1/2] fix: SeamHttpMultiWorkspaceInvalidOptionsError message --- src/lib/seam/connect/options.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/seam/connect/options.ts b/src/lib/seam/connect/options.ts index 1699e381..35d30cd4 100644 --- a/src/lib/seam/connect/options.ts +++ b/src/lib/seam/connect/options.ts @@ -238,4 +238,9 @@ export class SeamHttpInvalidOptionsError extends Error { } } -export class SeamHttpMultiWorkspaceInvalidOptionsError extends SeamHttpInvalidOptionsError {} +export class SeamHttpMultiWorkspaceInvalidOptionsError extends Error { + constructor(message: string) { + super(`SeamHttpMultiWorkspace received invalid options: ${message}`) + this.name = this.constructor.name + } +} From fbb5b563f571dcb67fe4ba4c4ad8340cffb4b7dc Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 17 Jul 2024 22:43:21 +0000 Subject: [PATCH 2/2] Add test for SeamHttpInvalidOptionsError --- test/seam/connect/env.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/seam/connect/env.test.ts b/test/seam/connect/env.test.ts index 0609cfa7..20ddcdbe 100644 --- a/test/seam/connect/env.test.ts +++ b/test/seam/connect/env.test.ts @@ -30,6 +30,16 @@ test.serial( }, ) +test.serial( + 'SeamHttp: constructor checks for SEAM_API_KEY environment variable', + (t) => { + t.throws(() => new SeamHttp(), { + instanceOf: SeamHttpInvalidOptionsError, + message: /SEAM_API_KEY/, + }) + }, +) + test.serial( 'SeamHttp: apiKey option overrides environment variables', async (t) => {