mirror of
https://github.com/openharmony/tools_previewer.git
synced 2026-07-19 04:07:44 -04:00
delete function not be need mock
Signed-off-by: sambaby <1337922982@qq.com>
This commit is contained in:
@@ -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`;
|
||||
|
||||
Reference in New Issue
Block a user