inversify-props icon indicating copy to clipboard operation
inversify-props copied to clipboard

[Question] How to use Jest

Open bobo-k2 opened this issue 3 years ago • 2 comments

I am wondering if there is a way to use Jest for mocking dependencies instead write custom mock classes and use mockSingleton or mockTransient?

bobo-k2 avatar Jun 11 '22 11:06 bobo-k2

I am using jest , vue3 , typescript and inversify-props, jest is for unit testing, while using, import {container} from "inversify-props" container.get<ServiceClass>('ServiceClass') this is working in project run command "npm run serve" while I run npm test this is throwing error.

Also I tried to use containerBuilder() but that is no exists in inversify-props but given in documentation to use for testing.

Suryadeep-bhujel avatar Dec 25 '23 16:12 Suryadeep-bhujel

This repo is really old and I cannot continue updating without help, I'm sorry. To be compatible with jest this will need help from a PR

CKGrafico avatar Jan 07 '24 19:01 CKGrafico