fix(core,testing): improve type safety and update tests for latest tstest and storage APIs

This commit is contained in:
2026-04-30 09:25:26 +00:00
parent 2e2726a4de
commit 45e24ecff3
19 changed files with 1394 additions and 1414 deletions
+10 -1
View File
@@ -97,6 +97,9 @@ tap.test('NPM: should publish package to smarts3', async () => {
username: 'testuser',
password: 'testpass',
});
if (!userId) {
throw new Error('Expected test user authentication to succeed');
}
const token = await authManager.createNpmToken(userId, false);
const packageData = {
@@ -157,6 +160,9 @@ tap.test('OCI: should store blob in smarts3', async () => {
username: 'testuser',
password: 'testpass',
});
if (!userId) {
throw new Error('Expected test user authentication to succeed');
}
const token = await authManager.createOciToken(
userId,
['oci:repository:test-image:push'],
@@ -260,8 +266,11 @@ tap.test('Cargo: should store crate in smarts3', async () => {
// Verify stored
const retrievedIndex = await storage.getCargoIndex('test-crate');
expect(retrievedIndex).toBeDefined();
if (!retrievedIndex) {
throw new Error('Expected Cargo index to be stored');
}
expect(retrievedIndex.length).toEqual(1);
expect(retrievedIndex[0].name).toEqual('test-crate');
expect(retrievedIndex[0]?.name).toEqual('test-crate');
});
/**