From a7f596aa0af8f9f59fac6505fcee995ed77563de Mon Sep 17 00:00:00 2001 From: cheney Date: Wed, 17 Jun 2026 10:25:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E9=80=9A=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- kit/doc/开发规范.md | 1 + kit/test/remote_manu_test.js | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 09f300b..52bf1b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules dist -build.json \ No newline at end of file +build.json +kit/.kit/modules/* diff --git a/kit/doc/开发规范.md b/kit/doc/开发规范.md index a7e280f..feac4bf 100644 --- a/kit/doc/开发规范.md +++ b/kit/doc/开发规范.md @@ -1,2 +1,3 @@ +- 每个函数都要有中文注释, 包括功能说明、参数说明、返回值说明等,如果有注意事项,也要在注释中特别说明。 - 每次需求修改都要同时更新文档、代码、测试代码。 - 每条测试用例都要有一个唯一编号。例如 1-1、2-20 等。 \ No newline at end of file diff --git a/kit/test/remote_manu_test.js b/kit/test/remote_manu_test.js index 28992d3..dfa6105 100644 --- a/kit/test/remote_manu_test.js +++ b/kit/test/remote_manu_test.js @@ -117,7 +117,7 @@ function trackRemote(group, projectId) { } manualDescribe("remote module public API manual webdav", () => { - manualTest("exposes documented public methods", async () => { + manualTest("1-1 exposes documented public methods", async () => { expect(typeof remote.check).toBe("function"); expect(typeof remote.publish).toBe("function"); expect(typeof remote.install).toBe("function"); @@ -127,11 +127,11 @@ manualDescribe("remote module public API manual webdav", () => { expect(typeof remote.remove).toBe("function"); }); - manualTest("check validates an available webdav client", async () => { + manualTest("1-2 check validates an available webdav client", async () => { expect(await remote.check()).toBe(true); }); - manualTest("publish stores files under default group /modules/id", async () => { + manualTest("1-3 publish stores files under default group /modules/id", async () => { const projectId = nextProjectId(); trackRemote("/modules", projectId); const projectDir = writeFixtureProject(tempDir, "1.0", "hello v1", { id: projectId }); @@ -151,7 +151,7 @@ manualDescribe("remote module public API manual webdav", () => { expect(artifact).toBe("hello v1"); }, 30000); - manualTest("publish supports custom nested group", async () => { + manualTest("1-4 publish supports custom nested group", async () => { const projectId = nextProjectId(); const group = `/kit-manual-test/${runId}/docker/net`; trackRemote(group, projectId); @@ -165,7 +165,7 @@ manualDescribe("remote module public API manual webdav", () => { expect(artifact).toBe("docker net"); }, 30000); - manualTest("empty group stores project at repository root", async () => { + manualTest("1-5 empty group stores project at repository root", async () => { const projectId = nextProjectId(); trackRemote("", projectId); await remote.publish(writeFixtureProject(tempDir, "1.0", "root group", { id: projectId, group: "" })); @@ -175,7 +175,7 @@ manualDescribe("remote module public API manual webdav", () => { expect(await remote.client.getFileContents(`/${projectId}/1.0/any/any/myapp.txt`, { format: "text" })).toBe("root group"); }, 30000); - manualTest("explicit version fails when remote version already exists", async () => { + manualTest("1-6 explicit version fails when remote version already exists", async () => { const projectId = nextProjectId(); trackRemote("/modules", projectId); await remote.publish(writeFixtureProject(tempDir, "1.0", "hello v1", { id: projectId })); @@ -183,7 +183,7 @@ manualDescribe("remote module public API manual webdav", () => { await expect(remote.publish(writeFixtureProject(tempDir, "1.0", "hello again", { id: projectId }))).rejects.toThrow("远程版本已存在"); }, 30000); - manualTest("blank version increments remote version tail or starts at 1.0", async () => { + manualTest("1-7 blank version increments remote version tail or starts at 1.0", async () => { const projectId = nextProjectId(); trackRemote("/modules", projectId); @@ -197,7 +197,7 @@ manualDescribe("remote module public API manual webdav", () => { expect(await remote.client.getFileContents(`/modules/${projectId}/1.1/any/any/myapp.txt`, { format: "text" })).toBe("second auto"); }, 30000); - manualTest("install downloads latest version from default group", async () => { + manualTest("1-8 install downloads latest version from default group", async () => { const projectId = nextProjectId(); trackRemote("/modules", projectId); await remote.publish(writeFixtureProject(tempDir, "1.0", "hello v1", { id: projectId })); @@ -215,7 +215,7 @@ manualDescribe("remote module public API manual webdav", () => { expect(fs.existsSync(path.resolve(moduleRoot, "current"))).toBe(true); }, 30000); - manualTest("install can target a custom group path", async () => { + manualTest("1-9 install can target a custom group path", async () => { const projectId = nextProjectId(); const group = `/kit-manual-test/${runId}/docker/net`; trackRemote(group, projectId); @@ -228,7 +228,7 @@ manualDescribe("remote module public API manual webdav", () => { expect(installedFile).toBe("docker install"); }, 30000); - manualTest("list use rollback and remove manage installed versions", async () => { + manualTest("1-10 list use rollback and remove manage installed versions", async () => { const projectId = nextProjectId(); trackRemote("/modules", projectId); await remote.publish(writeFixtureProject(tempDir, "1.0", "hello v1", { id: projectId }));