StateVoicesNational / Spoke

mass-contact text/SMS distribution tool
Other
460 stars 400 forks source link

Jest Text Encoder Configuration #2340

Closed engelhartrueben closed 4 months ago

engelhartrueben commented 4 months ago

Fixes # (issue)

Fixes issue where test would fail due to TextEncoder issues. Specifically:

const "pg" = require(pg) // or something of that sort

Description

Include TextEncoder and TextDecoder as global var for jest. Lost this support in the jsdom with V16. jsdom is a pure-JavaScript implementation of many web standards, notably the WHATWG DOM and HTML Standards, for use with Node.js. In general, the goal of the project is to emulate enough of a subset of a web browser to be useful for testing and scraping real-world web applications.

For the node20-update-aa branch, this allowed an additional 45 tests (630 to 675) to pass.

Checklist: