How to properly unit test initialisation of pg-promise via jest.mock / jest.mocked methods? #941
Replies: 1 comment
-
We do not cover issues with test frameworks here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, I have setup my code as follows:
and my test as follows:
Unfortunately, the test fails with:
TypeError: pgp is not a function
The following works:
But I am looking to use jest.mocked so I can check that pgp function is called with the correct parameters since these might come from an external configuration.
I am using the following library versions:
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions