File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/signals/signals/src/core/signal-generators/network-gen/__tests__ Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -61,14 +61,19 @@ describe(NetworkInterceptor, () => {
6161 LOADING = 3
6262 DONE = 4
6363
64- private _emitter = new EventEmitter ( )
64+ private _emitter : EventEmitter
6565 public readyState = 0
6666 public status = 0
6767 public responseText = ''
68- public onreadystatechange : ( ( ) => void ) | null = null
6968 public responseURL = ''
7069 public _responseMethod = ''
7170 public _responseHeaders = ''
71+ public onreadystatechange = ( ) => undefined
72+ constructor ( ) {
73+ this . _emitter = new EventEmitter ( ) . on ( 'readystatechange' , ( ) => {
74+ this . onreadystatechange ( )
75+ } )
76+ }
7277
7378 open ( method : string , url : string ) {
7479 this . _responseMethod = method
@@ -93,9 +98,6 @@ describe(NetworkInterceptor, () => {
9398 this . responseURL = 'http://example.com'
9499 this . _responseHeaders = 'Content-Type: application/json'
95100 this . _emitter . emit ( 'readystatechange' )
96- if ( this . onreadystatechange ) {
97- this . onreadystatechange ( )
98- }
99101 } , 40 )
100102 }
101103
You can’t perform that action at this time.
0 commit comments