-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat: add beforeEach and afterEach hooks #11
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11 +/- ##
==========================================
- Coverage 82.72% 82.67% -0.05%
==========================================
Files 3 3
Lines 272 277 +5
==========================================
+ Hits 225 229 +4
- Misses 47 48 +1
Continue to review full report at Codecov.
|
Hey thanks! This still has some work to go (types and docs), but we also need to thinking about the implementation. I've had this originally too, but it doesn't account for:
I will also ping you from #9 about another discussion point |
I implemented the idea you suggested in #9 , added missing docs, added missing types, and handle hooks exceptions. Can you help me to find a way to test if it works? |
Sorry @hyanmandian 🙈 Can you revert that last commit? It actually causes more issues with timing and control flow than the previous state. The rest is looking good! I can add the missing bits to what was there. |
This reverts commit 4491478.
Done @lukeed ! |
This is looking good, thanks @hyanmandian! I'll be able to add the remaining bits tonight 🙌 |
write(PASS); | ||
num++; | ||
} catch (err) { | ||
for (hook of aEach) await hook(); |
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.
Sorry for the delay – I was thinking about it, and this is all the "additional cleanup" that was needed.
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.
Nice!
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.
Tests pass – coverage dropped a tiny bit (compared to your last commit) because of the line I added.
Thank you! 🙌
Closes #9