mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-01 18:19:51 +00:00
05e1271376
Enables the vitest/prefer-expect-resolves oxlint rule and applies its autofix across the spec suite.
26 lines
715 B
TypeScript
26 lines
715 B
TypeScript
import * as httpMock from '~test/http-mock.ts';
|
|
import { JiraHttp, setBaseUrl } from './jira.ts';
|
|
|
|
describe('util/http/jira', () => {
|
|
const api = new JiraHttp();
|
|
|
|
it('throws error if setBaseUrl not called', async () => {
|
|
await expect(api.postJson('some-path')).rejects.toThrow('Invalid URL');
|
|
});
|
|
|
|
it('accepts custom baseUrl', async () => {
|
|
const siteUrl = 'https://some-site.atlassian.com';
|
|
httpMock.scope(siteUrl).post('/some-path').reply(200, {});
|
|
setBaseUrl(siteUrl);
|
|
|
|
await expect(api.postJson('some-path')).resolves.toEqual({
|
|
authorization: false,
|
|
body: {},
|
|
headers: {
|
|
'content-type': 'application/json',
|
|
},
|
|
statusCode: 200,
|
|
});
|
|
});
|
|
});
|