@@ -101,6 +101,18 @@ describe('Tech Insights router tests', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('/checks/run', () => {
|
||||
it('should continue to run all checks if a single one fails', async () => {
|
||||
await request(app)
|
||||
.post('/checks/run')
|
||||
.query({
|
||||
entity: 'a:a/a',
|
||||
ids: ['check1', 'check2'],
|
||||
})
|
||||
.expect(500);
|
||||
});
|
||||
});
|
||||
|
||||
describe('/facts/latest', () => {
|
||||
it('should be able to parse id request params for fact retrieval', async () => {
|
||||
await request(app)
|
||||
|
||||
@@ -124,8 +124,7 @@ export async function createRouter<
|
||||
}
|
||||
});
|
||||
const results = await Promise.all(tasks);
|
||||
const noResults =
|
||||
results.length === 0 || results.flatMap(r => r.results).length === 0;
|
||||
const noResults = results.flatMap(r => r.results).length === 0;
|
||||
if (errors.length > 0 && noResults) {
|
||||
return res.status(500).send({ errors, results });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user