!109 fix convertxml Mock

Merge pull request !109 from 苏重威/master
This commit is contained in:
openharmony_ci
2022-01-10 06:51:47 +00:00
committed by Gitee
3 changed files with 24 additions and 14 deletions
@@ -0,0 +1,19 @@
import { paramMock } from "../utils"
export function mockConvertXml() {
const result = {
ConvertXML: function(...args) {
console.warn("convertXml.ConvertXML interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
return ConvertXMLMock;
}
}
const ConvertXMLMock = {
convert: function(...args) {
console.warn("ConvertXML.convert interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
return paramMock.paramObjectMock;
}
}
return result;
}
@@ -37,6 +37,7 @@ import { mockBundle } from './bundle'
import { mockInnerBundle } from './innerBundleManager'
import { mockUri } from './uri'
import { mockXml } from './xml'
import { mockConvertXml } from './convertxml'
import { mockStatfs } from './statfs'
import { mockSettings } from './settings'
import { mockAbilityAccessCtrl } from './abilityAccessCtrl'
@@ -122,6 +123,8 @@ export function mockRequireNapiFun() {
return mockUri();
case "xml":
return mockXml();
case "convertxml":
return mockConvertXml();
case "statfs":
return mockStatfs();
case "settings":
+2 -14
View File
@@ -11,11 +11,6 @@ export function mockXml() {
console.warn("xml.XmlPullParser interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
return XmlPullParserMock;
},
ConvertXML: function(...args) {
console.warn("xml.ConvertXML interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
return ConvertXMLMock;
}
}
const XmlSerializerMock = {
@@ -58,20 +53,13 @@ export function mockXml() {
setDocType: function(...args) {
console.warn("XmlSerializer.setDocType interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
},
}
}
const XmlPullParserMock = {
parse: function(...args) {
console.warn("XmlPullParser.parse interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
},
}
const ConvertXMLMock = {
convert: function(...args) {
console.warn("ConvertXML.convert interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
return paramMock.paramObjectMock;
},
}
}
return result;
}