Small tweak

Signed-off-by: sblausten <sam@roadie.io>
This commit is contained in:
sblausten
2022-12-20 12:00:42 +01:00
parent 138b37994a
commit a5ea625550
2 changed files with 13 additions and 2 deletions
@@ -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 });
}