Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bufbuild/jest-environment-jsdom
A modern jsdom test environment for Jest
https://github.com/bufbuild/jest-environment-jsdom
jest jest-environment-jsdom jsdom
Last synced: 27 days ago
JSON representation
A modern jsdom test environment for Jest
- Host: GitHub
- URL: https://github.com/bufbuild/jest-environment-jsdom
- Owner: bufbuild
- License: apache-2.0
- Created: 2023-08-10T17:15:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-02T19:05:32.000Z (about 1 month ago)
- Last Synced: 2025-01-02T19:37:42.649Z (about 1 month ago)
- Topics: jest, jest-environment-jsdom, jsdom
- Language: TypeScript
- Homepage: https://buf.build
- Size: 636 KB
- Stars: 4
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
![The Buf logo](./.github/buf-logo.svg)
jest-environment-jsdom
===========[![License](https://img.shields.io/github/license/bufbuild/jest-environment-jsdom?color=blue)](./LICENSE) [![Build](https://github.com/bufbuild/jest-environment-jsdom/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/bufbuild/jest-environment-jsdom/actions/workflows/ci.yaml) [![NPM Version](https://img.shields.io/npm/v/@bufbuild/jest-environment-jsdom/latest?color=green&label=%40bufbuild%2Fjest-environment-jsdom)](https://www.npmjs.com/package/@bufbuild/jest-environment-jsdom)
An extension of [jest-environment-jsdom](https://www.npmjs.com/package/jest-environment-jsdom)
with support for the [Encoding API](https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API).## Installation
Note that `jest-environment-jsdom` is still required as a peer dependency:
```bash
npm install --save-dev jest-environment-jsdom @bufbuild/jest-environment-jsdom
```## Usage
Update the `testEnvironment` property of your Jest config like so:
```diff
import type { Config } from 'jest';const config: Config = {
- testEnvironment: 'jsdom',
+ testEnvironment: '@bufbuild/jest-environment-jsdom',
...
};
```Full documentation can be found in the package [README](packages/jest-environment-jsdom).
## Packages
- [@bufbuild/jest-environment-jsdom](https://www.npmjs.com/package/@bufbuild/jest-environment-jsdom):
Jest test environment with support for the Encoding API.## Status: Beta
This project is in beta, which means we may make a few changes as we gather feedback from early adopters.
Join us on [Slack](https://buf.build/links/slack) to stay updated on future releases.## Legal
Offered under the [Apache 2 license](./LICENSE).