mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-24 22:48:06 +00:00
8b3a066756
As we're now managing them via a `afterEach` in `test/setup.ts`, we can remove any entries in tests themselves. We don't update overrides of an outer hook or cases where there are more explicit `clear()`s. Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
36 lines
865 B
TypeScript
36 lines
865 B
TypeScript
import * as hostRules from '../host-rules.ts';
|
|
import { clear, getQueue } from './queue.ts';
|
|
|
|
describe('util/http/queue', () => {
|
|
beforeEach(() => {
|
|
clear();
|
|
hostRules.add({
|
|
matchHost: 'example.com',
|
|
concurrentRequestLimit: 143,
|
|
});
|
|
});
|
|
|
|
it('returns null for invalid URL', () => {
|
|
expect(getQueue('$#@!')).toBeNull();
|
|
});
|
|
|
|
it('returns queue for valid url', () => {
|
|
const q1a = getQueue('https://example.com');
|
|
const q1b = getQueue('https://example.com');
|
|
|
|
const q2a = getQueue('https://example.com:8080');
|
|
const q2b = getQueue('https://example.com:8080');
|
|
|
|
expect(q1a).not.toBeNull();
|
|
expect(q1a).toBe(q1b);
|
|
|
|
expect(q2a).not.toBeNull();
|
|
expect(q2a).toBe(q2b);
|
|
|
|
expect(q1a).not.toBe(q2a);
|
|
expect(q1a).not.toBe(q2b);
|
|
expect(q1b).not.toBe(q2a);
|
|
expect(q1b).not.toBe(q2b);
|
|
});
|
|
});
|