You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1007 B
JavaScript
36 lines
1007 B
JavaScript
const assert = require("node:assert/strict");
|
|
const fs = require("node:fs");
|
|
const path = require("node:path");
|
|
const test = require("node:test");
|
|
|
|
const source = fs.readFileSync(
|
|
path.resolve(__dirname, "../src/views/demand/business-feasibility.vue"),
|
|
"utf8",
|
|
);
|
|
const api = fs.readFileSync(
|
|
path.resolve(__dirname, "../src/api/studentTrainingAnswer.js"),
|
|
"utf8",
|
|
);
|
|
const request = fs.readFileSync(
|
|
path.resolve(__dirname, "../src/utils/request.js"),
|
|
"utf8",
|
|
);
|
|
|
|
test("商业可行性报告上传兼容公共上传接口的顶层文件地址", () => {
|
|
assert.match(
|
|
source,
|
|
/const url = response\?\.url \|\| response\?\.data\?\.url \|\| ""/,
|
|
);
|
|
});
|
|
|
|
test("商业可行性报告校验失败仅交由页面显示中文提示", () => {
|
|
assert.match(
|
|
api,
|
|
/business-feasibility\/step-3\/validate[\s\S]{0,240}skipErrorMessage:\s*true/,
|
|
);
|
|
assert.match(
|
|
request,
|
|
/code !== 200[\s\S]{0,260}skipErrorMessage[\s\S]{0,260}Promise\.reject\(new Error\(msg\)\)/,
|
|
);
|
|
});
|