-
Notifications
You must be signed in to change notification settings - Fork 1.8k
test: improve shared helpers #2362
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Makes testing easier +++++
@reggi Made some more changes after you reviewed - re-requesting. Might be easiest to just check the new commits. Sorry about that! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one little nit you can take or leave, but otherwise LGTM! Great refactor on withClient
here, I think it's really evolving into something we'd want to use everywhere
test/functional/index.test.js
Outdated
const withClient = require('./shared').withClient; | ||
const withMonitoredClient = require('./shared').withMonitoredClient; | ||
const shared = require('./shared'); | ||
const { withClient, withMonitoredClient } = shared; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we're destructuring anyway it looks like just about all of these come from shared
:
const {
withClient,
withMonitoredClient,
assert,
setupDatabase
} = require('./shared');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbroadst I updated a few things since your review, can you take a look when you get a chance? Refactoring withMonitoredClient
exposed an issue in withClient
, where it was swallowing errors returned by the done(err)
callback in tests. I've updated withClient
to now throw those errors after cleanup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Loving the quality of life changes here, making it easier to test! 🥳
Description
NODE-2605
What changed?
withTempDb
client
argument ofwithClient
optionalmakeCleanupFn
intowithClient
connectToDb
helperfilterForCommands
/filterOutCommands
/withMonitoredClient
shared.js
Also introduced some CI-related cleanup:
eslint
version before lintingnvm
and use--no-progress
option to clean up log outputAre there any files to ignore?