Skip to content
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

Added more plugin tests #1969

Merged
merged 18 commits into from
Oct 5, 2021

Conversation

RunDevelopment
Copy link
Member

@RunDevelopment RunDevelopment commented Jul 11, 2019

This adds more plugin tests and a new way to create Prism instances inside a JSDOM VM.

It also fixes that Copy to Clipboard did not update the copied text if the text of the code element changed.
This can technically be seen as a fix for #1965.


Also, I just named the tests files basic-functionality for lack of a better name. Suggestions for a better pattern are very welcome.

@github-actions
Copy link

github-actions bot commented Oct 1, 2021

No JS Changes

Generated by 🚫 dangerJS against df8ee50

@RunDevelopment
Copy link
Member Author

RunDevelopment commented Oct 1, 2021

Shit, I forgot about this.

I resolved the merge conflicts and addressed all review comments.

I fixed the usage of after by adding a util function called createScopedPrismDom. The idea is that this function creates a Prism DOM and registers a cleanup function for the DOM. It's called reusable because the DOM instance is intended to be used by multiple it tests.

I also updated JSDom. JSDom 16 added support for createRange which drastically simplifies Keep Markup tests.

@RunDevelopment
Copy link
Member Author

I will merge this now because I want to implement update #2640 and this PR will cause conflicts.

@RunDevelopment RunDevelopment merged commit a394a14 into PrismJS:master Oct 5, 2021
@RunDevelopment RunDevelopment deleted the more-plugin-tests branch October 5, 2021 20:13
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