website refactor

This commit is contained in:
2026-01-17 22:55:03 +01:00
parent 64d9e7fd16
commit 69d4cce7f1
64 changed files with 1146 additions and 1014 deletions

View File

@@ -41,16 +41,16 @@ export function createContainer(): Container {
/**
* Creates a container for testing with mock overrides
*/
export function createTestContainer(overrides: Map<symbol, any> = new Map()): Container {
export async function createTestContainer(overrides: Map<symbol, any> = new Map()): Promise<Container> {
const container = createContainer();
// Apply mock overrides using rebind
Array.from(overrides.entries()).forEach(([token, mockInstance]) => {
container.rebind(token).then(bind => bind.toConstantValue(mockInstance));
const promises = Array.from(overrides.entries()).map(([token, mockInstance]) => {
return container.rebind(token).then(bind => bind.toConstantValue(mockInstance));
});
// Return container immediately, mocks will be available after promises resolve
// For synchronous testing, users can bind directly before loading modules
await Promise.all(promises);
return container;
}