From 22ca202d3cf2605537db8a52ca47f97f1542ec6b Mon Sep 17 00:00:00 2001 From: sambaby <1337922982@qq.com> Date: Fri, 15 Sep 2023 17:39:30 +0800 Subject: [PATCH] delete function not be need mock Signed-off-by: sambaby <1337922982@qq.com> --- automock/mock-generate/src/generate/generateExportFunction.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/automock/mock-generate/src/generate/generateExportFunction.ts b/automock/mock-generate/src/generate/generateExportFunction.ts index 1975bd8..d198950 100644 --- a/automock/mock-generate/src/generate/generateExportFunction.ts +++ b/automock/mock-generate/src/generate/generateExportFunction.ts @@ -27,6 +27,9 @@ import { getCallbackStatement, getReturnStatement } from './generateCommonUtil'; * @returns */ export function generateExportFunction(functionEntity: FunctionEntity, sourceFile: SourceFile, mockApi: string): string { + if (functionEntity.functionName !== 'getContext') { + return ''; + } let functionBody = ''; functionBody = `global.${functionEntity.functionName} = function (...args) {`; functionBody += `console.warn('The ${functionEntity.functionName} interface in the Previewer is a mocked implementation and may behave differently than on a real device.');\n`;