-
Notifications
You must be signed in to change notification settings - Fork 50
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
How to set a variable to Kong Context while doing unit tests? #171
Comments
Hey! @lays147 Thank you for sending your question! Does the link that @Water-Melon sent above help (☝️)? There's some documentation that should explain how to use kong.ctx (context). Would that work for your use case? |
Hi @nowNick no. As I said, the context var on the test pdk is not available. I can use it on writing a plugin, but I can't manage the context on the text setup. Because in this case, I'm retrieving a var from the context, not setting it. Also, the docs are wrong because to use |
Oh! Ok I see. Apologies for the confusion then! I'll take a deeper look at this and I'll try to offer better guidance / report bugs. |
That's awesome @winslowdibona! Thank you for your contribution! |
Hey @winslowdibona |
Solved by #174 |
Hi,
I'm trying to write a couple of unit tests for a plugin that I'm doing, and based on the docs, I can't see where I could add a variable to the
kong.context
for the purpose of the unit test.Checking the source code, the Ctx is available at
env.pdk
, but this variable is not available for external access.The text was updated successfully, but these errors were encountered: