-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat(report): allow override of report timestamp dir structure #103
base: master
Are you sure you want to change the base?
Conversation
beb628c
to
24d01fe
Compare
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.
Would recommend a test where you supply a bad value for this configuration and validate the error handling.
@@ -47,7 +47,8 @@ const reportDir = function reportDir(cb) { | |||
log('reportDir: output:reports not defined'); | |||
return cb(null, this); | |||
} | |||
let tsDirName = moment().format('MM-DD-YYYY/HH-mm-ss'); | |||
const pathTimestampFormat = this.config.get('output:pathTimestampFormat') || 'MM-DD-YYYY/HH-mm-ss'; | |||
let tsDirName = moment().format(pathTimestampFormat); |
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.
Since this is a user supplied configuration, we may want to wrap this in a try/catch or otherwise figure out how to handle the case where the value provided is invalid.
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.
I'm also interested in what issues arise if we pass in a "valid" but unexpected value like foo
. Will we run into errors if multiple tests/runs try to write to the same folder?
Perhaps we don't have to handle all these cases and users will be able determine the errors are due to their custom config value 🤷♂️
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
@@ -82,7 +82,7 @@ | |||
"yargs": "^15.0.1" | |||
}, | |||
"devDependencies": { | |||
"chromedriver": "^83.0.0", | |||
"chromedriver": "^85.0.1", |
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.
we can change this to:
"chromedriver": "latest",
so we don't have to keep updating this value
Add
output.pathTimestampFormat
config option to allow overriding of timestamp folder structure. (I'd like to put the year first, myself.)@grawk Appreciate any pointers on adding tests!