MCPcopy Index your code
hub / github.com/YMFE/yapi / handleScriptTest

Method handleScriptTest

server/controllers/open.js:367–388  ·  view source on GitHub ↗
(interfaceData, response, validRes, requestParams)

Source from the content-addressed store, hash-verified

365 }
366
367 async handleScriptTest(interfaceData, response, validRes, requestParams) {
368
369 try {
370 let test = await yapi.commons.runCaseScript({
371 response: response,
372 records: this.records,
373 script: interfaceData.test_script,
374 params: requestParams
375 }, interfaceData.col_id, interfaceData.interface_id, this.getUid());
376 if (test.errcode !== 0) {
377 test.data.logs.forEach(item => {
378 validRes.push({
379 message: item
380 });
381 });
382 }
383 } catch (err) {
384 validRes.push({
385 message: 'Error: ' + err.message
386 });
387 }
388 }
389
390 handleReqHeader(req_header, envData, curEnvName) {
391 let currDomain = handleCurrDomain(envData, curEnvName);

Callers 3

handleTestMethod · 0.95
tFunction · 0.80

Calls 2

runCaseScriptMethod · 0.80
getUidMethod · 0.45

Tested by

no test coverage detected