expect specific errors

Signed-off-by: Brian DeHamer <bdehamer@github.com>
This commit is contained in:
Brian DeHamer
2026-02-18 10:26:30 -08:00
parent 2ee9744a24
commit 1f1e5c092b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -90,7 +90,7 @@ describe('predicateFromInputs', () => {
predicate: 'not valid json'
}
await expect(predicateFromInputs(inputs)).rejects.toThrow()
await expect(predicateFromInputs(inputs)).rejects.toThrow(/JSON/)
})
})
@@ -136,7 +136,7 @@ describe('predicateFromInputs', () => {
predicatePath: filePath
}
await expect(predicateFromInputs(inputs)).rejects.toThrow()
await expect(predicateFromInputs(inputs)).rejects.toThrow(/JSON/)
})
})
})
+1 -1
View File
@@ -38,7 +38,7 @@ describe('parseSBOMFromPath', () => {
const filePath = path.join(tempDir, 'invalid.json')
await fs.writeFile(filePath, 'not valid json')
await expect(parseSBOMFromPath(filePath)).rejects.toThrow()
await expect(parseSBOMFromPath(filePath)).rejects.toThrow(/JSON/)
})
it('should throw when file exceeds maximum size', async () => {