website refactor
This commit is contained in:
@@ -167,14 +167,14 @@ describe('SponsorService', () => {
|
||||
|
||||
it('throws using error.message when details.message is missing', async () => {
|
||||
const input: CreateSponsorInputDTO = { name: 'Test', contactEmail: 'test@example.com' };
|
||||
createSponsorUseCase.execute.mockResolvedValue(Result.err({ code: 'VALIDATION_ERROR', message: 'Boom' } as any));
|
||||
createSponsorUseCase.execute.mockResolvedValue(Result.err({ code: 'VALIDATION_ERROR', message: 'Boom' } as never));
|
||||
|
||||
await expect(service.createSponsor(input)).rejects.toThrow('Boom');
|
||||
});
|
||||
|
||||
it('throws default message when details.message and message are missing', async () => {
|
||||
const input: CreateSponsorInputDTO = { name: 'Test', contactEmail: 'test@example.com' };
|
||||
createSponsorUseCase.execute.mockResolvedValue(Result.err({ code: 'VALIDATION_ERROR' } as any));
|
||||
createSponsorUseCase.execute.mockResolvedValue(Result.err({ code: 'VALIDATION_ERROR' } as never));
|
||||
|
||||
await expect(service.createSponsor(input)).rejects.toThrow('Failed to create sponsor');
|
||||
});
|
||||
@@ -476,7 +476,7 @@ describe('SponsorService', () => {
|
||||
});
|
||||
|
||||
it('throws on error', async () => {
|
||||
getSponsorBillingUseCase.execute.mockResolvedValue(Result.err({ code: 'REPOSITORY_ERROR' } as any));
|
||||
getSponsorBillingUseCase.execute.mockResolvedValue(Result.err({ code: 'REPOSITORY_ERROR' } as never));
|
||||
await expect(service.getSponsorBilling('s1')).rejects.toThrow('Sponsor billing not found');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user