Skip to content

Ending database connection for tests #39

@matthewdking

Description

@matthewdking

This came up last week I think, when running tests it hangs afterwards as the connection to the db stays open.

Ensure dbConnection is required in to the test file

// using pg
tape.onFinish(() => {
  dbConnection.end()
})

// using pg-promise
tape.onFinish(() => {
  dbConnection.$pool.end()
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions