提交 d75e2cb3 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

fix(uts): 自动化测试调整结果数据类型

上级 512b881d
......@@ -81,11 +81,11 @@ export function onMessage(msg: string) {
return
}
const params = JSON.stringify(json.params)
const res = new Map<string, any | null>([['id', json.id]])
const res = { id: json.id }
try {
const callback = (result?: any | null, error?: any | null) => {
res.set('result', result)
res.set('error', error)
res['result'] = result
res['error'] = error
send(res)
}
if (method.startsWith('App.')) {
......@@ -199,7 +199,7 @@ export function onMessage(msg: string) {
}
}
} catch (error) {
res.set('error', { message: error.stackTraceToString() })
res['error'] = { message: error.stackTraceToString() }
send(res)
}
}
......@@ -207,7 +207,7 @@ export function onMessage(msg: string) {
export function initAutomator() {
// @ts-ignore
socketTask = uni.connectSocket({
url: wsEndpoint
url: wsEndpoint!
});
socketTask!.onMessage((res) => {
onMessage(res.data as string)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册