| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- const makeId = require("../../util/makeId");
- const dayjs = require("dayjs");
- /**
- * @description 代码作业一次部署的基本信息
- * @typedef {Object} UnitTestSerializerType
- * @property {number} id 代码作业一次单元测试的 id
- * @property {number} time 测试时间
- * @property {string|number} buildId 对应的构建 id
- * @property {OneUnitTestSerializerType[]} detail 所有测试用例列表
- */
- /**
- * @description 代码作业一次部署的基本信息
- * @typedef {Object} OneUnitTestSerializerType
- * @property {number} id 一个测试用例的 id
- * @property {boolean} isPass 是否通过
- * @property {string} message 输出
- */
- /**
- * @description 生成UnitTestSerializer
- * @returns {UnitTestSerializerType}
- */
- module.exports = ({ id = makeId(), buildId = makeId() }) => {
- /**
- * @return {OneUnitTestSerializerType}
- */
- const getOneUnitTestSerializer = () => ({
- id: makeId(),
- isPass: id % 2 === 1,
- message:
- "One Function alTes tSerializerOne FunctionalTestSerializer OneFunc tionalT estSerializer"
- });
- return {
- id,
- buildId,
- time: dayjs("2018-9-21").unix(),
- detail: [
- getOneUnitTestSerializer(),
- getOneUnitTestSerializer(),
- getOneUnitTestSerializer(),
- getOneUnitTestSerializer(),
- getOneUnitTestSerializer(),
- getOneUnitTestSerializer(),
- getOneUnitTestSerializer()
- ]
- };
- };
|