Fix failing unit tests

* This PR caused the Sidebar.test.ts file tests to fail because TransformStream is not found.
* TransformStream exists in the Node version I'm testing with (20), but it still isn't found by Jest
* Turns out it is a problem with Jest, and the workaround is the simple package jest-fixed-jsdom, which subclasses JSDOMEnvironment testing environment, placing this and several other dependencies in its global object.

* In package.json
  - add jest-fixed-jsdom as a devDependency

* In jest.config.cjs
  - change testEnvironment to jest-fixed-jsdom
This commit is contained in:
cliffhall
2025-04-23 17:52:17 -04:00
parent 498e49e2d8
commit bf1026b6ec
3 changed files with 16 additions and 1 deletions

View File

@@ -52,6 +52,7 @@
"@types/jest": "^29.5.14",
"@types/node": "^22.7.5",
"@types/shell-quote": "^1.7.5",
"jest-fixed-jsdom": "^0.0.9",
"prettier": "3.3.3",
"typescript": "^5.4.2"
}