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) {
47
47
export async function runHTK ( options : {
48
48
configPath ?: string
49
49
} = { } ) {
50
+ const startTime = Date . now ( ) ;
51
+
50
52
const configPath = options . configPath || envPaths ( 'httptoolkit' , { suffix : '' } ) . config ;
51
53
52
54
await ensureDirectoryExists ( configPath ) ;
53
55
await checkBrowserConfig ( configPath ) ;
54
56
57
+ const configCheckTime = Date . now ( ) ;
58
+ console . log ( 'Config checked in' , configCheckTime - startTime , 'ms' ) ;
59
+
55
60
const httpsConfig = await generateHTTPSConfig ( configPath ) ;
56
61
62
+ const certSetupTime = Date . now ( ) ;
63
+ console . log ( 'Certificates setup in' , certSetupTime - configCheckTime , 'ms' ) ;
64
+
57
65
// Start a standalone server
58
66
const standalone = getStandalone ( {
59
67
serverDefaults : {
@@ -95,5 +103,6 @@ export async function runHTK(options: {
95
103
96
104
await htkServer . start ( ) ;
97
105
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' ) ;
99
108
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ describe('Integration test', function () {
26
26
27
27
return new Promise ( ( resolve , reject ) => {
28
28
serverProcess . stdout . on ( 'data' , ( d ) => {
29
- resolve ( ) ;
29
+ if ( d . includes ( 'Server started' ) ) resolve ( ) ;
30
30
stdout = stdout + d . toString ( ) ;
31
31
console . log ( d . toString ( ) ) ;
32
32
} ) ;
@@ -49,7 +49,7 @@ describe('Integration test', function () {
49
49
serverProcess . kill ( ) ;
50
50
51
51
expect ( stderr ) . to . equal ( '' ) ;
52
- expect ( stdout ) . to . equal ( 'Server started\n ') ;
52
+ expect ( stdout ) . to . contain ( '\nServer started') ;
53
53
} ) ;
54
54
55
55
it ( 'starts a Mockttp server' , async ( ) => {
You can’t perform that action at this time.
0 commit comments