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