fix(core,testing): improve type safety and update tests for latest tstest and storage APIs
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user