File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ describe('printEnvCommand', () => {
1515 // See : https://stackoverflow.com/questions/56349619/ts2352-declare-object-with-dynamic-properties-and-one-property-with-specific-t
1616 const printEnvCommand = await initPrintEnvCommand ( {
1717 log,
18- ENV : { NODE_ENV : NodeEnv . Test } ,
18+ ENV : {
19+ NODE_ENV : NodeEnv . Test ,
20+ } ,
1921 } ) ;
2022 const result = await printEnvCommand ( {
2123 command : 'whook' ,
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { type JsonObject } from 'type-fest';
77import { YError } from 'yerror' ;
88
99export type SendMailEnvVars = {
10- SMTP_CONNECTION_URL : string ;
10+ SMTP_CONNECTION_URL ? : string ;
1111} ;
1212export type SendMailDependencies = {
1313 ENV : SendMailEnvVars ;
@@ -19,6 +19,10 @@ async function initSendMail({
1919 ENV ,
2020 log = noop ,
2121} : SendMailDependencies ) : Promise < SendMailService > {
22+ if ( ! ENV . SMTP_CONNECTION_URL ) {
23+ throw new YError ( 'E_NO_SMTP_URL' ) ;
24+ }
25+
2226 const transporter = createTransport ( {
2327 host : new URL ( ENV . SMTP_CONNECTION_URL ) . hostname ,
2428 port : parseInt ( new URL ( ENV . SMTP_CONNECTION_URL ) . port , 10 ) ,
You can’t perform that action at this time.
0 commit comments