First stab at adding support for setup() and teardown()#65
First stab at adding support for setup() and teardown()#65DmitrySharabin merged 4 commits intomainfrom
setup() and teardown()#65Conversation
✅ Deploy Preview for h-test ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
LGTM. Though it might be a simpler design to just define no-op setup() and teardown() methods (so there's always something there) and then just assign any user-provided ones to this.setup/this.teardown. I think it would lead to strictly less code, since we now have two methods that do nothing more than call two other methods :P Even the context is the same.
Co-authored-by: Lea Verou <lea@verou.me>
That's an excellent idea! I have a question, though. I used UPDATE I think I know the answer: we can simply do |
d2a1c80 to
536abea
Compare
|
Thank you for your suggestions on how to improve the design. 🙏 Now, the code is much-much simpler. |
Co-authored-by: Lea Verou <lea@verou.me>
I still need to add some docs, but I want to ensure I get the idea right.
My local experiments with another project show that those inheritable methods work.
@LeaVerou, I'd love to hear your thoughts on this.