Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: clean up getConnection() test properly #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/integration/connectable/get-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ describe('Connectable ::', function() {
});
});

after(function(done) {
manager.pool.end(done);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the mp-postgresql destroyManager method for this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you 🙂

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about this more, I think the above approach is preferable to using the library under test for cleanup.

});

it('should successfully return a PG Client instance', function(done) {
Pack.getConnection({
manager: manager
Expand All @@ -38,9 +42,7 @@ describe('Connectable ::', function() {

// Assert that a PG Client is returned
assert(report.connection instanceof pg.Client);

// Assert that the connection has a release function
assert(report.connection.release);
assert('function' === typeof report.connection.release);

return done();
});
Expand Down