no message

This commit is contained in:
yinjun.chen1
2026-09-14 14:40:59 +08:00
parent 1eef16a332
commit 54b2a470c2
5 changed files with 385 additions and 119 deletions
+12
View File
@@ -118,6 +118,18 @@ describe("env-store - 环境 CRUD", () => {
const env = await EnvStore.getActiveEnv();
assert.equal(env.id, "e3");
});
it("超过 5 个环境时抛错", async () => {
// 已有 3 个,再加 2 个到上限
await EnvStore.createEnvironment("env4");
await EnvStore.createEnvironment("env5");
const { environments } = await EnvStore.loadEnvironments();
assert.equal(environments.length, 5);
// 第 6 个应被拒绝
await assert.rejects(() => EnvStore.createEnvironment("env6"), /最多 5 个环境/);
const after = await EnvStore.loadEnvironments();
assert.equal(after.environments.length, 5);
});
});
describe("env-store - 配置 CRUD", () => {