-
Notifications
You must be signed in to change notification settings - Fork 111
automatically clean up aftereach with optout using VTL_SKIP_AUTO_CLEANUP #80
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
automatically clean up aftereach with optout using VTL_SKIP_AUTO_CLEANUP #80
Conversation
Codecov Report
@@ Coverage Diff @@
## master #80 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 1 1
Lines 63 66 +3
Branches 10 12 +2
=====================================
+ Hits 63 66 +3
Continue to review full report at Codecov.
|
This looks good, can you add a couple of tests illustrating the usage of VTL_SKIP_AUTO_CLEANUP? |
I will add the test to it right away |
Can you please take a look at this! |
Done!!! |
Hi @Oluwasetemi! This looks awesome, thank you 🙌 I was making sure everything was in place, and came up with an idea. What if we used // auto-cleanup-skip.js
test('first test render a vue component', () => {
render({
template: `<h1>Hello World</h1>`
})
expect(document.body.innerHTML).toMatchInlineSnapshot(`
<div>
<h1>Hello World</h1>
</div>
`)
})
test('no cleanup should have happened, renders the first component still', () => {
expect(document.body.innerHTML).toMatchInlineSnapshot(`
<div>
<h1>Hello World</h1>
</div>
`)
}) // auto-cleanup.js
test('render the first component', () => {
render({
template: `<h1>Hello World</h1>`
})
expect(document.body.innerHTML).toMatchInlineSnapshot(`
<div>
<h1>Hello World</h1>
</div>
`)
})
test('cleans up after each test by default', () => {
expect(document.body.innerHTML).toMatchInlineSnapshot(`""`)
}) What do you think about it? I just wrote |
It definitely looks better. This is way better than the previous implementation of the tests. It will be visible to anyone who checks through the test to understand the cleanup and auto clean up properly. |
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.
This looks great to me 👌
How will the docs be updated? |
Docs live in https://github.com/testing-library/testing-library-docs/, so a PR should be created there with the appropriate changes. |
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.
Agree with @afontcu , great work, thanks for this
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes #77