expect specific errors
Signed-off-by: Brian DeHamer <bdehamer@github.com>
This commit is contained in:
@@ -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/)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user