Closed Abdul-Sen closed 4 years ago
Thanks for taking this up! Added one small comment.
Hey can i close this PR and continue to add new unit tests for other utilities under the same issue but with different PRs? I apologize I am still fairly to open source contributions.
Hi @Abdul-Sen -- why not keep this open, and make other PRs from different branches? You can make multiple PRs to the same repo, from different branches, and keep them separate that way.
If you can fix the array-of-strings case, I'd be happy to merge this PR in 👍
12 . Hi, I wrote some tests for the
stringifyDomainPattern
utility and fixed some bugs that my unit tests came across in the function.There were 2 minor changes made to the utility function and the reasons for those changes are listed below :
Change # 1
Initially my
should stringify a single regex expression to RegExp
test was failing with the following error:I fixed this issue by simply adding a
)
in the return string tostringifyDomainPattern
function insrc/utils.js
that seemed to be missing because of a typo which then ran my unit test successfully:Change # 2
I noticed that the function also accepts array of regex patterns but the return was without
RegExp
but still had parentheses which indicated that theRegExp
function missing was a mistake. It also made for inconsistant string returns. This then caused my testshould stringify an array of domain patterns to RegExp
to break with the folowing output:I simply added
RegExp
to the return string and that change made my test succeedPlease let me know if anything needs to be reverted or if there is something else you'd like me to do to meet the merge requirements.