chore: strengthen backend eslint profile
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { ServiceUnavailableException } from '@nestjs/common';
|
||||
|
||||
import { NcrRatingsClient } from './ncr-ratings.client';
|
||||
const isin = 'RU000A10EW44';
|
||||
const row = (value = 'AAA.ru', code = isin, href = '/ratings/issues/123/') =>
|
||||
@@ -65,6 +66,18 @@ describe('public NCR issue ratings', () => {
|
||||
);
|
||||
},
|
||||
);
|
||||
it.each(['AA+.ru', 'B-.ru', 'BBB+.ru', 'CCC-.ru', 'CC.ru', 'D.ru'])(
|
||||
'accepts the public rating grammar: %s', async (value) => {
|
||||
jest.spyOn(global, 'fetch').mockResolvedValue(response(table(row(value))));
|
||||
expect(await new NcrRatingsClient().rating(isin)).toMatchObject({ value });
|
||||
},
|
||||
);
|
||||
it.each(['AAA+.ru', 'CC-.ru', 'BBBB.ru', 'BBB++.ru'])(
|
||||
'rejects invalid rating grades: %s', async (value) => {
|
||||
jest.spyOn(global, 'fetch').mockResolvedValue(response(table(row(value))));
|
||||
await expect(new NcrRatingsClient().rating(isin)).rejects.toBeInstanceOf(ServiceUnavailableException);
|
||||
},
|
||||
);
|
||||
it('bounds outage retries then recovers without retaining a false missing rating', async () => {
|
||||
const fetchMock = jest
|
||||
.spyOn(global, 'fetch')
|
||||
|
||||
Reference in New Issue
Block a user