feat(core,storage,oci,registry-config): add streaming response support and configurable registry URLs across protocols
This commit is contained in:
@@ -2,6 +2,7 @@ import { tap, expect } from '@git.zone/tstest';
|
||||
import { RegistryStorage } from '../ts/core/classes.registrystorage.js';
|
||||
import { CargoRegistry } from '../ts/cargo/classes.cargoregistry.js';
|
||||
import { AuthManager } from '../ts/core/classes.authmanager.js';
|
||||
import { streamToJson } from '../ts/core/helpers.stream.js';
|
||||
|
||||
// Test index path calculation
|
||||
tap.test('should calculate correct index paths for different crate names', async () => {
|
||||
@@ -123,9 +124,10 @@ tap.test('should return valid config.json', async () => {
|
||||
|
||||
expect(response.status).to.equal(200);
|
||||
expect(response.headers['Content-Type']).to.equal('application/json');
|
||||
expect(response.body).to.be.an('object');
|
||||
expect(response.body.dl).to.include('/api/v1/crates/{crate}/{version}/download');
|
||||
expect(response.body.api).to.equal('http://localhost:5000/cargo');
|
||||
const body = await streamToJson(response.body);
|
||||
expect(body).to.be.an('object');
|
||||
expect(body.dl).to.include('/api/v1/crates/{crate}/{version}/download');
|
||||
expect(body.api).to.equal('http://localhost:5000/cargo');
|
||||
});
|
||||
|
||||
export default tap.start();
|
||||
|
||||
Reference in New Issue
Block a user