@@ -514,7 +514,8 @@ function useGenerateTest(test, projectFilePath) {
514514 let filePath = ipcRenderer . sendSync ( 'Universal.path' , projectFilePath , serverFilePath ) ;
515515 filePath = filePath . replace ( / \\ / g, '/' ) ;
516516 testFileCode = `const app = require('../${ filePath } ');
517- const supertest = require('supertest')
517+ const supertest = require('supertest');
518+ const regeneratorRuntime = require('regenerator-runtime');
518519 const request = supertest(app)\n` ;
519520 } else testFileCode = 'Please Select A Server!' ;
520521 if ( dbFilePath ) {
@@ -749,7 +750,7 @@ function useGenerateTest(test, projectFilePath) {
749750
750751 // // Endpoint Jest Test Code
751752 const addEndpoint = ( statement ) => {
752- testFileCode += `\n test('${ statement . testName } ', async () => {\n const response = await request.${ statement . method } ('${ statement . route } ')` ;
753+ testFileCode += `\n test('${ statement . testName } ', async () => {\n const response = await request.${ statement . method } ('${ statement . route } '); ` ;
753754 testFileCode += statement . postData
754755 ? `.send( ${ statement . postData . trim ( ) } )\n.set({'Content-Type': 'application/json',`
755756 : statement . headers . length
@@ -768,7 +769,7 @@ function useGenerateTest(test, projectFilePath) {
768769 . replace ( / \( ( [ ^ ) ] + ) \) / , '' )
769770 . split ( ' ' )
770771 . join ( '' ) ;
771- testFileCode += `expect(response.${ expectedResponse . toLowerCase ( ) } )` ;
772+ testFileCode += `\n expect(response.${ expectedResponse . toLowerCase ( ) } )` ;
772773 testFileCode += not ? `.not.${ matcher } (${ value } );` : `.${ matcher } (${ value } );` ;
773774 } ) ;
774775 testFileCode += '});' ;
0 commit comments