File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,8 @@ export const getAppList = (): string[] => {
146146}
147147
148148export async function initApp ( inOtomiStack ?: OtomiStack ) {
149- const lightship = createLightship ( )
149+ // Only create lightship in production (not in tests)
150+ const lightship = env . isTest ? null : createLightship ( )
150151 const app = express ( )
151152 const apiRoutesPath = path . resolve ( __dirname , 'api' )
152153 await loadSpec ( )
@@ -176,15 +177,15 @@ export async function initApp(inOtomiStack?: OtomiStack) {
176177 server = app
177178 . listen ( PORT , async ( ) => {
178179 debug ( `Listening on :::${ PORT } ` )
179- lightship . signalReady ( )
180+ lightship ? .signalReady ( )
180181 // Clone repo after the application is ready to avoid Pod NotReady phenomenon, and thus infinite Pod crash loopback
181182 ; ( await getSessionStack ( ) ) . initGit ( )
182183 } )
183184 . on ( 'error' , ( e ) => {
184185 console . error ( e )
185- lightship . shutdown ( )
186+ lightship ? .shutdown ( )
186187 } )
187- lightship . registerShutdownHandler ( ( ) => {
188+ lightship ? .registerShutdownHandler ( ( ) => {
188189 ; ( server as Server ) . close ( )
189190 } )
190191 }
You can’t perform that action at this time.
0 commit comments