Skip to content

Commit 360b0a1

Browse files
authored
fix: SeamHttpMultiWorkspaceInvalidOptionsError message (#124)
* fix: SeamHttpMultiWorkspaceInvalidOptionsError message * Add test for SeamHttpInvalidOptionsError
1 parent 3748497 commit 360b0a1

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/lib/seam/connect/options.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,9 @@ export class SeamHttpInvalidOptionsError extends Error {
238238
}
239239
}
240240

241-
export class SeamHttpMultiWorkspaceInvalidOptionsError extends SeamHttpInvalidOptionsError {}
241+
export class SeamHttpMultiWorkspaceInvalidOptionsError extends Error {
242+
constructor(message: string) {
243+
super(`SeamHttpMultiWorkspace received invalid options: ${message}`)
244+
this.name = this.constructor.name
245+
}
246+
}

test/seam/connect/env.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ test.serial(
3030
},
3131
)
3232

33+
test.serial(
34+
'SeamHttp: constructor checks for SEAM_API_KEY environment variable',
35+
(t) => {
36+
t.throws(() => new SeamHttp(), {
37+
instanceOf: SeamHttpInvalidOptionsError,
38+
message: /SEAM_API_KEY/,
39+
})
40+
},
41+
)
42+
3343
test.serial(
3444
'SeamHttp: apiKey option overrides environment variables',
3545
async (t) => {

0 commit comments

Comments
 (0)