Skip to content

Document context support in before & after hooks #1711

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

Merged
merged 1 commit into from
Feb 14, 2018

Conversation

novemberborn
Copy link
Member

Fixes #1579.

Heads up @kugtong33.

@kugtong33
Copy link
Contributor

kugtong33 commented Feb 14, 2018

👍 , I was heading on creating a PR for this, should I reference it still? :D , or nah

https://github.com/kugtong33/ava/blob/before-hook-context-document/readme.md

@novemberborn
Copy link
Member Author

@kugtong33 looks like I beat you to it, sorry. Wanted to get this in so I can do a new release. Let me know if there's anything you'd like to see changed in my version though.

@kugtong33
Copy link
Contributor

@novemberborn , I think the important part is to determine what values are shared/referenced and what values are independent in each test, and better examples would be fine, as I have added on my side we can give examples for referenced values and primitive values and how they can use contexts correctly.

We can also create a recipe for it, migrating declared variables outside of hooks into using contexts. On my side, I am heavily using supertest and I would love to try to use contexts on passing supertest responses from hooks to tests.

@novemberborn
Copy link
Member Author

@kugtong33 a recipe would be good. It's too much to capture in the README itself.

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.

2 participants