Skip to content

Commit c27a949

Browse files
author
Eric Wheeler
committed
test: fix command validation test descriptions
Update test descriptions to accurately reflect that tests verify errors are prevented rather than thrown. This aligns the descriptions with their .not.toThrow() assertions. Signed-off-by: Eric Wheeler <[email protected]>
1 parent 58bff0e commit c27a949

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

webview-ui/src/__tests__/utils/command-validation.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe("command-validation", () => {
4848
}).not.toThrow()
4949
})
5050

51-
it("should throw an error when parsing commands with $RANDOM in array index", () => {
51+
it("should not throw an error when parsing commands with $RANDOM in array index", () => {
5252
// This test reproduces the specific bug reported in the error
5353
const commandWithRandom = "level=${levels[$RANDOM % ${#levels[@]}]}"
5454

@@ -75,7 +75,7 @@ describe("command-validation", () => {
7575
}).not.toThrow()
7676
})
7777

78-
it("should throw an error with complex array indexing using $RANDOM and arithmetic", () => {
78+
it("should not throw an error with complex array indexing using $RANDOM and arithmetic", () => {
7979
// This test reproduces the exact expression from the original error
8080
const commandWithComplexRandom = "echo ${levels[$RANDOM % ${#levels[@]}]}"
8181

@@ -84,7 +84,7 @@ describe("command-validation", () => {
8484
}).not.toThrow("Bad substitution")
8585
})
8686

87-
it("should throw an error when parsing the full log generator command", () => {
87+
it("should not throw an error when parsing the full log generator command", () => {
8888
// This is the exact command from the original error message
8989
const logGeneratorCommand = `while true; do \\
9090
levels=(INFO WARN ERROR DEBUG); \\
@@ -101,7 +101,7 @@ done`
101101
}).not.toThrow("Bad substitution: levels[$RANDOM")
102102
})
103103

104-
it("should throw an error when parsing just the problematic part", () => {
104+
it("should not throw an error when parsing just the problematic part", () => {
105105
// This isolates just the part mentioned in the error message
106106
const problematicPart = "level=${levels[$RANDOM"
107107

0 commit comments

Comments
 (0)