Files
mermaid/packages
quilicicf 4145879003 test(refactor): Use real-ish rendering instead of heavy mocking in unit tests
* Creates a utility method `jsdomIt` that overrides `it` from `vitest` and fakes a browser environment by :
  * Creating a DOM with `jsdom` (and `canvas`)
  * Adding (for the duration of the test) that DOM's `window` and `document` on `global`
  * Monkey-patching DOM methods that require a rendering engine (`Element.getBBox` & `Element.getComputedLength`)
* Removes all d3 mocking since it can now work normally in `jsdomIt` tests
* Re-writes existing rendering tests to :
  * Use `jsdomIt`
  * Get rid of most of the involved mocking
  * Run `expect` calls on the generated SVG instead

Inspired by d3's own test code mocking : https://github.com/d3/d3-selection/blob/v3.0.0/test/jsdom.js
2025-07-14 14:04:52 +02:00
..
2025-04-17 17:38:53 -04:00
2025-06-19 12:43:20 +00:00
2025-06-19 12:43:20 +00:00
2025-07-07 15:21:07 +00:00