File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ const PORT = 8000;
1111const START_TIMEOUT = 1000 ;
1212const TEST_TIMEOUT = 3000 ;
1313
14+ let callId = 0 ;
15+
1416console . log ( 'System test started' ) ;
1517setTimeout ( async ( ) => {
1618 worker . postMessage ( { name : 'stop' } ) ;
@@ -24,8 +26,9 @@ const tasks = [
2426 { get : '/' , status : 302 } ,
2527 { get : '/console.js' } ,
2628 {
27- post : '/api/signIn' ,
28- data : { login : 'marcus' , password : 'marcus' }
29+ post : '/api' ,
30+ method : 'signIn' ,
31+ args : { login : 'marcus' , password : 'marcus' }
2932 }
3033] ;
3134
@@ -42,8 +45,9 @@ const getRequest = task => {
4245 request . method = 'POST' ;
4346 request . path = task . post ;
4447 }
45- if ( task . data ) {
46- task . data = JSON . stringify ( task . data ) ;
48+ if ( task . args ) {
49+ const packet = { call : ++ callId , [ task . method ] : task . args } ;
50+ task . data = JSON . stringify ( packet ) ;
4751 request . headers = {
4852 'Content-Type' : 'application/json' ,
4953 'Content-Length' : task . data . length
You can’t perform that action at this time.
0 commit comments