Skip to content

Document context support in before & after hooks#1711

Merged
novemberborn merged 1 commit intomasterfrom
doc-hook-context
Feb 14, 2018
Merged

Document context support in before & after hooks#1711
novemberborn merged 1 commit intomasterfrom
doc-hook-context

Conversation

@novemberborn
Copy link
Copy Markdown
Member

Fixes #1579.

Heads up @kugtong33.

@kugtong33
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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