An open API service indexing awesome lists of open source software.

https://github.com/nickserv/jest-environment-url

Load a URL into JSDOM for testing
https://github.com/nickserv/jest-environment-url

jest jsdom testing

Last synced: 2 months ago
JSON representation

Load a URL into JSDOM for testing

Awesome Lists containing this project

README

          

# `jest-environment-url`

Load a URL into JSDOM for testing

## Status

This is an experiment that hasn't been extensively tested yet, but feedback is welcome

## Installation

```sh
npm install --save-dev jest-environment-url
```

```sh
yarn add --dev jest-environment-url
```

## Configuration

### JSON

```json
"testEnvironment": "jest-environment-url",
"testEnvironmentOptions": {
"url": "https://example.com/"
}
```

### DocBlock

```js
/**
* @jest-environment url
* @jest-environment-options {"url": "https://example.com/"}
*/
```

## [Example](test.ts)

## Inspiration

Based on [`jest-environment-jsdom`](https://github.com/facebook/jest/tree/main/packages/jest-environment-jsdom) (© Facebook with [MIT license](https://choosealicense.com/licenses/mit/))