Skip to content
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

Merged
merged 5 commits into from Nov 12, 2021

Conversation

kiptrs
Copy link
Contributor

@kiptrs kiptrs commented Nov 12, 2021

Fixes

#1735

Checks

  • Ran yarn test-build
  • Updated relevant documentations
  • Updated matching config options in altair-static

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.

Copy link
Collaborator

@imolorhe imolorhe left a 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;
Copy link
Collaborator

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.

@kiptrs
Copy link
Contributor Author

kiptrs commented Nov 12, 2021

Thanks for making the changes! Left just one comment. Also please could you add some tests for the getFullUrl method?

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?

Copy link
Collaborator

@imolorhe imolorhe left a 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.

@imolorhe imolorhe merged commit 19af277 into altair-graphql:staging Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

altair-static endpointUrl gets prepended when using an environment variable on it
2 participants