-
-
Notifications
You must be signed in to change notification settings - Fork 488
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: reportTitle option (allow reproducible build) #354
Conversation
a3bb309
to
f1592a1
Compare
Yeah this is looking much better, thanks! It seems that the CLI currently requires the I'm not sure if we have test coverage for the old title, either, so if you're in the mood, having some OK-level coverage for the existing title generation logic would be nice (i.e. if we can test the title generation without having to stub time, it would be nice — a regex-test on the title would also suffice) |
f1592a1
to
7fc5dff
Compare
Ah yes; that was fairly low quality of me to not include those tests (particularly as the default was became buggy). I've gone for a very vague regex for the title, mainly to eliminate potentially stringified error values |
Looking much better! Now the default title is duplicated, and I wonder if we could de-duplicate and put it into Also for the regex, I think we can be a bit more strict and hopefully make the regex a bit more clear. What do you think of using this regex? expect(generatedReportTitle).to.match(/^webpack-bundle-analyzer \[.* at \d{2}:\d{2}\]/u); I'm not sure if there's a situation where If however we would not like to rely on expect(generatedReportTitle).to.match(/^.+ \[.* at \d{2}:\d{2}\]/u); |
9fbba1c
to
56ea889
Compare
Adds CLI options '-t' and '--title' taking strings Adds api option 'reportTitle' taking strings and functions Retains existing title behaviours as a default function Updates README Adds tests for plugin option reportTitle as string, function, errored function and default value Adds tests for cli option title as string and default value
56ea889
to
c2a12da
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.
Splendid! Thank you
Allows setting the HTML report title
tests
Tests are included, they test string and function reportTitle set through the plugin API, and error propagation for the function reportTitle
why
I, and increasingly others, require reproducible builds with CI; this is a more specific PR targeting a single option after comments on a more general PR #349