mirror of
https://gitee.com/openharmony/third_party_jsframework
synced 2024-11-27 00:40:37 +00:00
!782 master分支解决system部分有实际实现的接口被mock掉了
Merge pull request !782 from fupengfei/master
This commit is contained in:
commit
3104153eba
@ -14,6 +14,8 @@
|
||||
*/
|
||||
|
||||
const systemIndexArray: Array<SystemIndexEntity> = [];
|
||||
const systemNoMockArray = ['system.app', 'system.configuration', 'system.device',
|
||||
'system.mediaquery', 'system.prompt', 'system.router'];
|
||||
|
||||
export function addToSystemIndexArray(systemIndexEntity: SystemIndexEntity) {
|
||||
systemIndexArray.push(systemIndexEntity);
|
||||
@ -31,8 +33,10 @@ export function generateSystemIndex(): string {
|
||||
let systemIndex = `import regeneratorRuntime from 'babel-runtime/regenerator'\n`;
|
||||
let exportFunction = '';
|
||||
systemIndexArray.forEach(value => {
|
||||
systemIndex += `import { ${value.mockFunctionName} } from './${value.filename}'\n`;
|
||||
exportFunction += `${value.mockFunctionName}();\n`;
|
||||
if (!systemNoMockArray.includes(value.filename.replace('_', '.'))) {
|
||||
systemIndex += `import { ${value.mockFunctionName} } from './${value.filename}'\n`;
|
||||
exportFunction += `${value.mockFunctionName}();\n`;
|
||||
}
|
||||
});
|
||||
systemIndex += `import {mockRequireNapiFun} from './napi/index';\n`;
|
||||
systemIndex += `export function mockSystemPlugin() {
|
||||
|
Loading…
Reference in New Issue
Block a user