Skip to content

feat: auto-cleanup #68

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 4 commits into from
Feb 28, 2020
Merged

feat: auto-cleanup #68

merged 4 commits into from
Feb 28, 2020

Conversation

timdeschryver
Copy link
Member

Closes #67

@tonivj5
Copy link
Contributor

tonivj5 commented Feb 27, 2020

You're a magician. I was just trying to see what is happening. And the only thing that I have discovered is that if I disable removeAngularAttributes the error goes away... Very good catch see that the body is mantaining all templates 👍

UPDATE:
Very interesting, if you comment fixture.nativeElement.removeAttribute('id') in testing.library.ts. The document doesn't need the cleanup 🤔

@tonivj5
Copy link
Contributor

tonivj5 commented Feb 27, 2020

Thinking about the fix, this error happens in every angular+jest setup, isn't it? 😕

@tonivj5
Copy link
Contributor

tonivj5 commented Feb 27, 2020

I have found where happens the "bug"
image

It seems to be on the Angular side. It query for old roots to remove them, but, how the id is being remove, Angular isn't be able to find them 😿

So, this answers my last question! 👏

@timdeschryver
Copy link
Member Author

Hmm interesting, thanks @tonivj5 !
Do you think we should still do this cleanup? I'm thinking of reverting the change to remove the root.

I'm definitely going to change the default in this version 😅

@timdeschryver
Copy link
Member Author

(if you want you can create a PR)

@tonivj5
Copy link
Contributor

tonivj5 commented Feb 28, 2020

Yes, if we use removeAngularAttributes the cleanup must be, because it prevents Angular from remove old roots. However, I think we should leave to Angular the task of remove its roots. I'm going to open a new PR proposing other cleanup (I think simpler) 👍

I'm definitely going to change the default in this version 😅

It could follow being enable by default, I guess it's enable by default to help in debug log (cleaner, I supose), isn't it?

@tonivj5
Copy link
Contributor

tonivj5 commented Feb 28, 2020

Here is the PR #69 👍

@timdeschryver timdeschryver changed the title auto cleanup feat: auto-cleanup Feb 28, 2020
@timdeschryver
Copy link
Member Author

🎉 This PR is included in version 9.0.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants