Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions tests/integration/specs/analyze/analyze-dependency-risks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,24 @@ describe('analyze dependency-risks', () => {
{ timeout: 15000 },
);

it('exits with code 1 when project does not exist (settings 404)', async () => {
const server = await harness
.newFakeServer()
.withAuthToken(VALID_TOKEN)
.withScaEnabled(true)
.start();
harness.withAuth(server.baseUrl(), VALID_TOKEN, TEST_ORG);
it(
'exits with code 1 when project does not exist (settings 404)',
async () => {
const server = await harness
.newFakeServer()
.withAuthToken(VALID_TOKEN)
.withScaEnabled(true)
.start();
harness.withAuth(server.baseUrl(), VALID_TOKEN, TEST_ORG);

const result = await harness.run('analyze dependency-risks --project demo');
const result = await harness.run('analyze dependency-risks --project demo');

expect(result.exitCode).toBe(1);
expect(result.stdout + result.stderr).toContain('Project demo not found');
expect(server.getRecordedRequests().some((r) => r.path === '/api/settings/values')).toBe(true);
});
expect(result.exitCode).toBe(1);
expect(result.stdout + result.stderr).toContain('Project demo not found');
expect(server.getRecordedRequests().some((r) => r.path === '/api/settings/values')).toBe(true);
},
{ timeout: 15000 },
);

it(
'exits with code 1 when SCA is disabled on the server',
Expand Down