Skip to content

Commit 8dc0359

Browse files
committed
fix tests
1 parent 126852a commit 8dc0359

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

tests/unit/args.test.ts

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,10 @@ describe("Tool args", () => {
152152
expect(() => schema.parse(longName)).toThrow("Cluster name must be 64 characters or less");
153153

154154
// Invalid characters
155-
expect(() => schema.parse("cluster@name")).toThrow(
156-
"Cluster name " + ALLOWED_CLUSTER_NAME_CHARACTERS_ERROR
157-
);
158-
expect(() => schema.parse("cluster name")).toThrow(
159-
"Cluster name " + ALLOWED_CLUSTER_NAME_CHARACTERS_ERROR
160-
);
161-
expect(() => schema.parse("cluster.name")).toThrow(
162-
"Cluster name " + ALLOWED_CLUSTER_NAME_CHARACTERS_ERROR
163-
);
164-
165-
expect(() => schema.parse("cluster/name")).toThrow(
166-
"Cluster name " + ALLOWED_CLUSTER_NAME_CHARACTERS_ERROR
167-
);
155+
expect(() => schema.parse("cluster@name")).toThrow(ALLOWED_CLUSTER_NAME_CHARACTERS_ERROR);
156+
expect(() => schema.parse("cluster name")).toThrow(ALLOWED_CLUSTER_NAME_CHARACTERS_ERROR);
157+
expect(() => schema.parse("cluster.name")).toThrow(ALLOWED_CLUSTER_NAME_CHARACTERS_ERROR);
158+
expect(() => schema.parse("cluster/name")).toThrow(ALLOWED_CLUSTER_NAME_CHARACTERS_ERROR);
168159
});
169160

170161
it("should accept exactly 64 characters", () => {
@@ -195,8 +186,8 @@ describe("Tool args", () => {
195186
expect(() => schema.parse(longUsername)).toThrow("Username must be 100 characters or less");
196187

197188
// Invalid characters
198-
expect(() => schema.parse("user@name")).toThrow("Username " + ALLOWED_USERNAME_CHARACTERS_ERROR);
199-
expect(() => schema.parse("user name")).toThrow("Username " + ALLOWED_USERNAME_CHARACTERS_ERROR);
189+
expect(() => schema.parse("user@name")).toThrow(ALLOWED_USERNAME_CHARACTERS_ERROR);
190+
expect(() => schema.parse("user name")).toThrow(ALLOWED_USERNAME_CHARACTERS_ERROR);
200191
});
201192

202193
it("should accept exactly 100 characters", () => {
@@ -394,17 +385,13 @@ describe("Tool args", () => {
394385
expect(() => AtlasArgs.clusterName().parse("a".repeat(65))).toThrow(
395386
"Cluster name must be 64 characters or less"
396387
);
397-
expect(() => AtlasArgs.clusterName().parse("invalid@name")).toThrow(
398-
"Cluster name " + ALLOWED_CLUSTER_NAME_CHARACTERS_ERROR
399-
);
388+
expect(() => AtlasArgs.clusterName().parse("invalid@name")).toThrow(ALLOWED_CLUSTER_NAME_CHARACTERS_ERROR);
400389

401390
expect(() => AtlasArgs.username().parse("")).toThrow("Username is required");
402391
expect(() => AtlasArgs.username().parse("a".repeat(101))).toThrow(
403392
"Username must be 100 characters or less"
404393
);
405-
expect(() => AtlasArgs.username().parse("invalid name")).toThrow(
406-
"Username " + ALLOWED_USERNAME_CHARACTERS_ERROR
407-
);
394+
expect(() => AtlasArgs.username().parse("invalid name")).toThrow(ALLOWED_USERNAME_CHARACTERS_ERROR);
408395
});
409396
});
410397
});

0 commit comments

Comments
 (0)