Add context test

This commit is contained in:
Alejandro Celaya
2025-11-15 10:57:39 +01:00
parent 4b655761c6
commit b6f1db57ee
3 changed files with 41 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ export const ContainerProvider = ContainerContext.Provider;
export const useDependencies = <T extends unknown[]>(...names: string[]): T => {
const container = useContext(ContainerContext);
if (!container) {
throw new Error('You cannot use "useDependency" outside of a ContainerProvider');
throw new Error('You cannot use "useDependencies" outside of a ContainerProvider');
}
return names.map((name) => {