File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 1+ const DEFAULT_SPEAKEASY_SERVER_URL = "grpc.speakeasyapi.dev:443"
2+
13export type Config = {
24 apiKey : string ;
35} ;
@@ -16,9 +18,9 @@ export class SpeakeasyClient {
1618
1719 const serverUrl = process . env . SPEAKEASY_SERVER_URL ;
1820 if ( serverUrl == null ) {
19- throw new Error ( "Speakeasy Server URL is required" ) ;
21+ this . serverUrl = DEFAULT_SPEAKEASY_SERVER_URL ;
22+ } else {
23+ this . serverUrl = serverUrl ;
2024 }
21-
22- this . serverUrl = serverUrl ;
2325 }
2426}
Original file line number Diff line number Diff line change @@ -10,12 +10,6 @@ jest.mock("../../src/transport", () => ({
1010
1111describe ( "Simple Express Server" , ( ) => {
1212 describe ( "with an initalized speakeasy instance" , ( ) => {
13- beforeEach ( ( ) => {
14- process . env . SPEAKEASY_SERVER_URL = "" ;
15- } ) ;
16- afterEach ( ( ) => {
17- process . env . SPEAKEASY_SERVER_URL = undefined ;
18- } ) ;
1913 it ( "properly calls transport once" , ( ) => {
2014 init ( { apiKey : "" } ) ;
2115 const app = createSimpleExpressApp ( ) ;
You can’t perform that action at this time.
0 commit comments