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
add variable checker to full url checker #1737
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.
Thanks for making the changes! Left just one comment. Also please could you add some tests for the getFullUrl
method?
@@ -165,6 +165,12 @@ export const getFullUrl = (url: string) => { | |||
return url; | |||
} | |||
|
|||
// regex to test if given string is an environment variable | |||
const regex = /^{{[a-zA-Z._]+}}$/gm; |
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.
There are several variable regexes in this file. Might be better to reuse one of them instead of creating a new one.
I'd be glad to. I noticed that for testing you're using jest, yet I can't find any examples. Could you point me to one? |
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.
Thanks for adding the tests! Just left a few suggestions and we are good to merge this.
Fixes
#1735
Checks
yarn test-build
Changes proposed in this pull request:
Added a regex to test if given string is an environment variable. If so - pass it as is, thus fixing the mentioned issue.