@@ -149,14 +149,15 @@ describe('test/egg.test.js', () => {
149
149
assert ( message === '[egg:core:ready_timeout] %s seconds later %s was still unable to finish.' ) ;
150
150
assert ( b === 10 ) ;
151
151
assert ( a === 'a' ) ;
152
+ console . log ( app . timing . toString ( ) ) ;
152
153
done ( ) ;
153
154
} ) ;
154
155
app . ready ( ( ) => {
155
156
throw new Error ( 'should not be called' ) ;
156
157
} ) ;
157
158
} ) ;
158
159
159
- it ( 'should log info when plugin is not ready' , done => {
160
+ it ( 'should log info when plugin is ready' , done => {
160
161
app = utils . createApp ( 'ready' ) ;
161
162
app . loader . loadAll ( ) ;
162
163
let message = '' ;
@@ -166,6 +167,7 @@ describe('test/egg.test.js', () => {
166
167
app . ready ( ( ) => {
167
168
assert ( / \[ e g g : c o r e : r e a d y _ s t a t ] e n d r e a d y t a s k a , r e m a i n \[ " b " ] / . test ( message ) ) ;
168
169
assert ( / \[ e g g : c o r e : r e a d y _ s t a t ] e n d r e a d y t a s k b , r e m a i n \[ ] / . test ( message ) ) ;
170
+ console . log ( app . timing . toString ( ) ) ;
169
171
done ( ) ;
170
172
} ) ;
171
173
} ) ;
@@ -206,6 +208,9 @@ describe('test/egg.test.js', () => {
206
208
assert ( app . beforeStartFunction === false ) ;
207
209
await app . ready ( ) ;
208
210
assert ( app . beforeStartFunction === true ) ;
211
+ const timeline = app . timing . toString ( ) ;
212
+ console . log ( timeline ) ;
213
+ assert . match ( timeline , / # 1 4 B e f o r e S t a r t i n a p p .j s : 3 : 7 / ) ;
209
214
} ) ;
210
215
211
216
it ( 'should beforeStart excute timeout without EGG_READY_TIMEOUT_ENV too short' , function ( done ) {
@@ -215,6 +220,10 @@ describe('test/egg.test.js', () => {
215
220
app . once ( 'ready_timeout' , id => {
216
221
const file = path . normalize ( 'test/fixtures/beforestart-with-timeout-env/app.js' ) ;
217
222
assert ( id . includes ( file ) ) ;
223
+ const timeline = app . timing . toString ( ) ;
224
+ console . log ( timeline ) ;
225
+ assert . match ( timeline , / ▇ \[ \d + m s N O T _ E N D ] - # 1 A p p l i c a t i o n S t a r t / ) ;
226
+ assert . match ( timeline , / ▇ \[ \d + m s N O T _ E N D ] - # 1 4 B e f o r e S t a r t i n a p p .j s : 3 : 7 / ) ;
218
227
done ( ) ;
219
228
} ) ;
220
229
} ) ;
@@ -224,6 +233,7 @@ describe('test/egg.test.js', () => {
224
233
app . loader . loadAll ( ) ;
225
234
app . once ( 'error' , err => {
226
235
assert ( err . message === 'not ready' ) ;
236
+ console . log ( app . timing . toString ( ) ) ;
227
237
done ( ) ;
228
238
} ) ;
229
239
} ) ;
@@ -236,6 +246,7 @@ describe('test/egg.test.js', () => {
236
246
throw new Error ( 'should not run' ) ;
237
247
} catch ( err ) {
238
248
assert ( err . message === 'not ready' ) ;
249
+ console . log ( app . timing . toString ( ) ) ;
239
250
}
240
251
} ) ;
241
252
@@ -760,6 +771,9 @@ describe('test/egg.test.js', () => {
760
771
'didReady' ,
761
772
'beforeClose' ,
762
773
] ) ;
774
+ console . log ( app . timing . toString ( ) ) ;
775
+ assert . match ( app . timing . toString ( ) , / e g g s t a r t t i m e l i n e : / ) ;
776
+ assert . match ( app . timing . toString ( ) , / # 1 A p p l i c a t i o n S t a r t / ) ;
763
777
} ) ;
764
778
} ) ;
765
779
0 commit comments