You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, i want to create jest setup based on runned medusa v2 that will be able to use test db and allow to create integrations tests based on MedusaService and MedusaWorkflows.
src/modules/product-attribute/__tests__/brand-service.test.ts
ProductAttributeModuleService
✕ should create new brand (2 ms)
● ProductAttributeModuleService › should create new brand
TypeError: Cannot read properties of undefined (reading 'getFreshManager')
12 | await super.createBrandModels([brandData]) :
13 | await super.updateBrandModels([brandData]);
> 14 |
| ^
15 | }
16 | }
17 | export default ProductAttributeModuleService
at ProductAttributeModuleService.descriptor.value [as createBrandModels] (node_modules/@medusajs/utils/src/modules-sdk/decorators/inject-manager.ts:42:56)
at ProductAttributeModuleService.storeBrand (src/modules/product-attribute/service.ts:14:25)
at Object.<anonymous> (src/modules/product-attribute/__tests__/brand-service.test.ts:16:66)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 0.999 s
Ran all test suites.
Does Medusa v2 has some utils method to start server or some kind build that allow run server in code. that will build all necessary dependencies and allow to use extended services in jest tests?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, i want to create jest setup based on runned medusa v2 that will be able to use test db and allow to create integrations tests based on MedusaService and MedusaWorkflows.
I have simple module with brand model:
error fail message:
Does Medusa v2 has some utils method to start server or some kind build that allow run server in code. that will build all necessary dependencies and allow to use extended services in jest tests?
Beta Was this translation helpful? Give feedback.
All reactions