@riddled/4play
TypeScript icon, indicating that this package has built-in type declarations

1.18.3 • Public • Published

Troubles with jsdom

JSDOM is supposed to be a library that implements webbrowser DOM, so that we can use and test browser-like behaviour in node. It's quite a good solution, if it wasn't for the fact that we already encountered two bugs in JSDOM, which caused us a lot of trouble and worry.

  1. window.getComputedStyle() doesn't take the specificity of selectors into account. At the time of writing the issue was still unresolved: https://github.com/jsdom/jsdom/issues/3318. Bug found in writing unit tests for view, we were trying to test whether certain decorations are applied and getComputedStyle() failed to return the proper values. We had to create a workaround, simply we didn't use CSS specificity for the values, which is an anti-pattern.
  2. document.createRange() is improperly implemented, resulting in getClientRects() not being defined somewhat arbitrarily. It would seam that it related to time and frame capturing in internal JSDOM implementations. The issue is still unresolved: https://github.com/jsdom/jsdom/issues/3002. We need to workaround this by disabling autocomplete checks in paste.test.js, which would work fine if it wasn't for the JSDOM bug.

Troubles with @codemirror

Package in @codemirror are not completely independent of one another. Often times, updating a version of one of them breaks something in the other. The silver lining is that the maintainers of code mirror, when releasing a change that can break something, very often release corresponding packages updates as well. That's why, it's a good idea to always update all of @codemirror dependencies at once, and never update them separately.

Readme

Keywords

none

Package Sidebar

Install

npm i @riddled/4play

Weekly Downloads

33

Version

1.18.3

License

UNLICENSED

Unpacked Size

86.6 kB

Total Files

57

Last publish

Collaborators

  • tomriddle