提交 20885469 编写于 作者: 杜庆泉's avatar 杜庆泉

增加Result自定义序列化逻辑

上级 99beeed6
...@@ -2,10 +2,19 @@ import { Matchers,NumberMatchers } from './Matchers.uts' ...@@ -2,10 +2,19 @@ import { Matchers,NumberMatchers } from './Matchers.uts'
export const describes = new Map<string, Result>() export const describes = new Map<string, Result>()
export class Result { export class Result implements io.dcloud.uts.json.IJsonStringify {
total = 0 total = 0
passed: string[] = [] passed: string[] = []
failed: string[] = [] failed: string[] = []
override toJSON():any|null{
let jsonRet = {
'total': this.total,
'passed': JSON.stringify(this.passed),
'failed': JSON.stringify(this.failed),
}
return jsonRet
}
} }
let result: Result = new Result() let result: Result = new Result()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册