feat(core,storage,oci,registry-config): add streaming response support and configurable registry URLs across protocols
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||||
import { SmartRegistry } from '../ts/index.js';
|
||||
import { streamToBuffer, streamToJson } from '../ts/core/helpers.stream.js';
|
||||
import {
|
||||
createTestRegistry,
|
||||
createTestTokens,
|
||||
@@ -79,7 +80,9 @@ tap.test('Integration: should handle /simple path for PyPI', async () => {
|
||||
|
||||
expect(response.status).toEqual(200);
|
||||
expect(response.headers['Content-Type']).toStartWith('text/html');
|
||||
expect(response.body).toContain('integration-test-py');
|
||||
const body = await streamToBuffer(response.body);
|
||||
const text = body.toString('utf-8');
|
||||
expect(text).toContain('integration-test-py');
|
||||
});
|
||||
|
||||
tap.test('Integration: should reject PyPI token for RubyGems endpoint', async () => {
|
||||
@@ -135,8 +138,9 @@ tap.test('Integration: should return 404 for unknown paths', async () => {
|
||||
});
|
||||
|
||||
expect(response.status).toEqual(404);
|
||||
expect(response.body).toHaveProperty('error');
|
||||
expect((response.body as any).error).toEqual('NOT_FOUND');
|
||||
const body = await streamToJson(response.body);
|
||||
expect(body).toHaveProperty('error');
|
||||
expect(body.error).toEqual('NOT_FOUND');
|
||||
});
|
||||
|
||||
tap.test('Integration: should retrieve PyPI registry instance', async () => {
|
||||
|
||||
Reference in New Issue
Block a user