Skip to content

best way to mock pg (using sinon?) for unit-tests #1056

@ReinsBrain

Description

@ReinsBrain

I'm using client pooling which (i think) further complicates the matter of trying to mock pg for unit tests. Really, I'd like test that the connection is being called (once) with the correct arguments... then, once the client is made available from the callback, test the query and params being passed.

Anybody have success with this and can offer guidance please? (Thanks in advance)
Rein

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions