From eba969659613e264cad733187f0d32007e08d8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E9=B9=B0?= <17kungfuboy@gmail.com> Date: Thu, 14 Jul 2022 19:06:55 +0800 Subject: [PATCH] feat: add scriptCache --- .../browser/src/app/pages/api/test/api-test.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/workbench/browser/src/app/pages/api/test/api-test.component.ts b/src/workbench/browser/src/app/pages/api/test/api-test.component.ts index 507d10fb6..2226bd1f1 100644 --- a/src/workbench/browser/src/app/pages/api/test/api-test.component.ts +++ b/src/workbench/browser/src/app/pages/api/test/api-test.component.ts @@ -51,6 +51,7 @@ export class ApiTestComponent implements OnInit, OnDestroy { response: {}, request: {}, }; + scriptCache = {}; testServer: TestServerLocalNodeService | TestServerServerlessService | TestServerRemoteService; REQUEST_METHOD = objectToArray(RequestMethod); REQUEST_PROTOCOL = objectToArray(RequestProtocol); @@ -149,6 +150,10 @@ export class ApiTestComponent implements OnInit, OnDestroy { this.testServer.close(); } private test() { + this.scriptCache = { + beforeScript: this.beforeScript, + afterScript: this.afterScript, + }; this.testServer.send('unitTest', { id: this.apiTab.tabID, action: 'ajax', @@ -178,7 +183,6 @@ export class ApiTestComponent implements OnInit, OnDestroy { }, id ); - // console.log('test'); this.messageService.send({ type: 'updateHistory', data: {} }); } }