PrismJS / PrismJS/prism

Use new RangeSelection API in tests

Open
#2,129 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
13k
Forks
1.4k
Avg merge
15h 36m
Merged PRs (30d)
3

Description

Motivation
We have some custom code for doing the range selection in our tests, which is lower-fidelity compared to an actual browser.

Description
JSDOM just implemented those APIs directly: https://github.com/jsdom/jsdom/pull/2719

We should use them in our tests instead of the mocks.

Alternatives
Leave it alone–we may not actually be catching any bugs with this change.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the custom range-selection mocks used in the tests and review how JSDOM's new RangeSelection APIs are exposed. Replace the test-side selection code with the JSDOM APIs, then run the affected test suite and confirm the tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.