File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,21 @@ async function generateHTTPSConfig(configPath: string) {
4747export async function runHTK ( options : {
4848 configPath ?: string
4949} = { } ) {
50+ const startTime = Date . now ( ) ;
51+
5052 const configPath = options . configPath || envPaths ( 'httptoolkit' , { suffix : '' } ) . config ;
5153
5254 await ensureDirectoryExists ( configPath ) ;
5355 await checkBrowserConfig ( configPath ) ;
5456
57+ const configCheckTime = Date . now ( ) ;
58+ console . log ( 'Config checked in' , configCheckTime - startTime , 'ms' ) ;
59+
5560 const httpsConfig = await generateHTTPSConfig ( configPath ) ;
5661
62+ const certSetupTime = Date . now ( ) ;
63+ console . log ( 'Certificates setup in' , certSetupTime - configCheckTime , 'ms' ) ;
64+
5765 // Start a standalone server
5866 const standalone = getStandalone ( {
5967 serverDefaults : {
@@ -95,5 +103,6 @@ export async function runHTK(options: {
95103
96104 await htkServer . start ( ) ;
97105
98- console . log ( 'Server started' ) ;
106+ console . log ( 'Server started in' , Date . now ( ) - certSetupTime , 'ms' ) ;
107+ console . log ( 'Total startup took' , Date . now ( ) - startTime , 'ms' ) ;
99108}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ describe('Integration test', function () {
2626
2727 return new Promise ( ( resolve , reject ) => {
2828 serverProcess . stdout . on ( 'data' , ( d ) => {
29- resolve ( ) ;
29+ if ( d . includes ( 'Server started' ) ) resolve ( ) ;
3030 stdout = stdout + d . toString ( ) ;
3131 console . log ( d . toString ( ) ) ;
3232 } ) ;
@@ -49,7 +49,7 @@ describe('Integration test', function () {
4949 serverProcess . kill ( ) ;
5050
5151 expect ( stderr ) . to . equal ( '' ) ;
52- expect ( stdout ) . to . equal ( 'Server started\n ') ;
52+ expect ( stdout ) . to . contain ( '\nServer started') ;
5353 } ) ;
5454
5555 it ( 'starts a Mockttp server' , async ( ) => {
You can’t perform that action at this time.
0 commit comments