@inrupt/jest-jsdom-polyfills

3.2.1 • Public • Published

@inrupt/jest-jsdom-polyfills

This package contains polyfills for Web APIs that we use from the Inrupt SDKs that don't currently exist in jsdom which is used by Jest.

Installation

  1. npm install --save-dev @inrupt/jest-jsdom-polyfills

Usage:

Add the following line to your Jest Test Setup file, usually you'll have this configured as jest.setup.ts or something similar.

import "@inrupt/jest-jsdom-polyfills"

Done, the SDKs should now have everything they need to be tested via jest / jsdom.

ESM / CJS Compatibility

The Inrupt SDKs currently rely on some modules that require ESM, in order to load those with Jest, you need to opt into using ESM and configure your environment appropriately.

Package Sidebar

Install

npm i @inrupt/jest-jsdom-polyfills

Weekly Downloads

27,104

Version

3.2.1

License

MIT

Unpacked Size

6.03 kB

Total Files

4

Last publish

Collaborators

  • astrid.vazquez
  • timbl
  • rubenverborgh
  • nseydoux
  • pmcb55
  • inrupt_ci