mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-19 08:46:56 +02:00
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: Declan Carroll <declan@n8n.io>
30 lines
841 B
TypeScript
30 lines
841 B
TypeScript
import { describe, expect, test } from 'vitest';
|
|
|
|
import { getReadinessUrl } from './url-helper';
|
|
|
|
describe('getReadinessUrl', () => {
|
|
test('uses the default health endpoint', () => {
|
|
expect(getReadinessUrl('http://localhost:5678')).toBe(
|
|
'http://localhost:5678/healthz/readiness',
|
|
);
|
|
});
|
|
|
|
test('uses a custom health endpoint', () => {
|
|
expect(getReadinessUrl('http://localhost:5678', '/health')).toBe(
|
|
'http://localhost:5678/health/readiness',
|
|
);
|
|
});
|
|
|
|
test('adds the leading slash a custom health endpoint may omit', () => {
|
|
expect(getReadinessUrl('http://localhost:5678', 'health')).toBe(
|
|
'http://localhost:5678/health/readiness',
|
|
);
|
|
});
|
|
|
|
test('drops a trailing slash of the base URL', () => {
|
|
expect(getReadinessUrl('http://localhost:5678/')).toBe(
|
|
'http://localhost:5678/healthz/readiness',
|
|
);
|
|
});
|
|
});
|