no message
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user