We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3651a22 commit ec4c3e9Copy full SHA for ec4c3e9
internal/commands/scan_test.go
@@ -2368,3 +2368,21 @@ func Test_parseArgs(t *testing.T) {
2368
}
2369
2370
2371
+
2372
+func Test_isValidJSONOrXML(t *testing.T) {
2373
+ tests := []struct {
2374
+ description string
2375
+ inputPath string
2376
+ output bool
2377
+ }{
2378
+ {"wrong file", "wrongfilepath", false},
2379
+ {"correct file", "data/package.json", true},
2380
+ }
2381
2382
+ for _, test := range tests {
2383
+ isValid, _ := isValidJSONOrXML(test.inputPath)
2384
+ if isValid != test.output {
2385
+ t.Errorf(" test case failed for params %v", test)
2386
2387
2388
+}
0 commit comments